diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-04-02 08:33:01 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-04-02 08:33:01 +0000 |
| commit | 48edaf17a330c1ec7852077a7c59e97875ad849e (patch) | |
| tree | 8b56e4a3a31a8fe7123e8b460f39821f000bd6ce | |
| parent | 98d3a0933806df70fc49f02e789c34b2b684421b (diff) | |
Advanced deprecations in contrib.auth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/auth/__init__.py | 11 | ||||
| -rw-r--r-- | django/contrib/auth/models.py | 7 | ||||
| -rw-r--r-- | django/contrib/auth/tests/auth_backends.py | 4 |
3 files changed, 1 insertions, 21 deletions
diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py index 232a822053..f11f8308e3 100644 --- a/django/contrib/auth/__init__.py +++ b/django/contrib/auth/__init__.py @@ -21,19 +21,10 @@ def load_backend(path): cls = getattr(mod, attr) except AttributeError: raise ImproperlyConfigured('Module "%s" does not define a "%s" authentication backend' % (module, attr)) - if not hasattr(cls, "supports_object_permissions"): - warn("Authentication backends without a `supports_object_permissions` attribute are deprecated. Please define it in %s." % cls, - DeprecationWarning) - cls.supports_object_permissions = False - - if not hasattr(cls, 'supports_anonymous_user'): - warn("Authentication backends without a `supports_anonymous_user` attribute are deprecated. Please define it in %s." % cls, - DeprecationWarning) - cls.supports_anonymous_user = False if not hasattr(cls, 'supports_inactive_user'): warn("Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in %s." % cls, - PendingDeprecationWarning) + DeprecationWarning) cls.supports_inactive_user = False return cls() diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 8a1702ec97..57d4b93e61 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -386,13 +386,6 @@ class User(models.Model): raise SiteProfileNotAvailable return self._profile_cache - def _get_message_set(self): - import warnings - warnings.warn('The user messaging API is deprecated. Please update' - ' your code to use the new messages framework.', - category=DeprecationWarning) - return self._message_set - message_set = property(_get_message_set) class Message(models.Model): """ diff --git a/django/contrib/auth/tests/auth_backends.py b/django/contrib/auth/tests/auth_backends.py index 256357a95e..63b65ad521 100644 --- a/django/contrib/auth/tests/auth_backends.py +++ b/django/contrib/auth/tests/auth_backends.py @@ -171,13 +171,9 @@ class RowlevelBackendTest(TestCase): self.user1 = User.objects.create_user('test', 'test@example.com', 'test') self.user2 = User.objects.create_user('test2', 'test2@example.com', 'test') self.user3 = User.objects.create_user('test3', 'test3@example.com', 'test') - self.save_warnings_state() - warnings.filterwarnings('ignore', category=DeprecationWarning, - module='django.contrib.auth') def tearDown(self): settings.AUTHENTICATION_BACKENDS = self.curr_auth - self.restore_warnings_state() # The get_group_permissions test messes with ContentTypes, which will # be cached; flush the cache to ensure there are no side effects # Refs #14975, #14925 |
