1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #25054 -- Added app_label to swapped model AttributeError

This commit is contained in:
Chris Lamb
2015-07-02 18:42:24 +01:00
committed by Tim Graham
parent 30a152a367
commit 61f3e22e38
2 changed files with 22 additions and 20 deletions

View File

@@ -270,9 +270,13 @@ class SwappedManagerDescriptor(object):
self.model = model
def __get__(self, instance, type=None):
raise AttributeError("Manager isn't available; %s has been swapped for '%s'" % (
self.model._meta.object_name, self.model._meta.swapped
))
raise AttributeError(
"Manager isn't available; '%s.%s' has been swapped for '%s'" % (
self.model._meta.app_label,
self.model._meta.object_name,
self.model._meta.swapped,
)
)
class EmptyManager(Manager):