Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Advanced deprecations in contrib.auth.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 48edaf17a330c1ec7852077a7c59e97875ad849e 1 parent 98d3a09
Russell Keith-Magee freakboy3742 authored
11 django/contrib/auth/__init__.py
View
@@ -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()
7 django/contrib/auth/models.py
View
@@ -386,13 +386,6 @@ def get_profile(self):
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):
"""
4 django/contrib/auth/tests/auth_backends.py
View
@@ -171,13 +171,9 @@ def setUp(self):
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
Please sign in to comment.
Something went wrong with that request. Please try again.