Skip to content

Commit 9c3f71c

Browse files
committed
Removed deprecated ACCOUNT_USE_AUTH_AUTHENTICATE
1 parent 384476a commit 9c3f71c

5 files changed

Lines changed: 2 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version with these. Your code will need to be updated to continue working.
77

88
* BI: account deletion callbacks moved to hooksets
99
* BI: dropped Django 1.7 support
10+
* BI: removed deprecated `ACCOUNT_USE_AUTH_AUTHENTICATE` setting with behavior matching its `True` value
1011
* added Turkish translations
1112
* fixed migration with language codes to dynamically set
1213

account/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class AccountAppConf(AppConf):
5555
HOOKSET = "account.hooks.AccountDefaultHookSet"
5656
TIMEZONES = TIMEZONES
5757
LANGUAGES = LANGUAGES
58-
USE_AUTH_AUTHENTICATE = False
5958

6059
def configure_hookset(self, value):
6160
return load_path_attr(value)()

account/views.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,7 @@ def after_signup(self, form):
282282
signals.user_signed_up.send(sender=SignupForm, user=self.created_user, form=form)
283283

284284
def login_user(self):
285-
user = self.created_user
286-
if settings.ACCOUNT_USE_AUTH_AUTHENTICATE:
287-
# call auth.authenticate to ensure we set the correct backend for
288-
# future look ups using auth.get_user().
289-
user = auth.authenticate(**self.user_credentials())
290-
else:
291-
# set auth backend to ModelBackend, but this may not be used by
292-
# everyone. this code path is deprecated and will be removed in
293-
# favor of using auth.authenticate above.
294-
user.backend = "django.contrib.auth.backends.ModelBackend"
285+
user = auth.authenticate(**self.user_credentials())
295286
auth.login(self.request, user)
296287
self.request.session.set_expiry(0)
297288

docs/faq.rst

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,3 @@ because you can choose not to do any email address storage.
3737
If you don't use a custom user model then make sure you take extra precaution.
3838
When editing email addresses either in the shell or admin make sure you update
3939
in both places. Only the primary email address is stored on the ``User`` model.
40-
41-
Why does auto-login after sign up not log my user in?
42-
=====================================================
43-
44-
If you are using Django 1.6+ and ``django.contrib.auth.backends.ModelBackend``
45-
does not exist in your ``AUTHENTICATION_BACKENDS`` then you will experience an
46-
issue where users are not logged in after sign up (when
47-
``ACCOUNT_EMAIL_CONFIRMATION_REQUIRED`` is ``False``.)
48-
49-
This has been fixed, but the default behavior is buggy (for this use case) to
50-
maintain backward compatibility. In a future version of django-user-accounts
51-
the default behavior will not be buggy.
52-
53-
To fix, simply set::
54-
55-
ACCOUNT_USE_AUTH_AUTHENTICATE = True
56-
57-
in your Django settings. This will cause the ``login_user`` method of
58-
``SignupView`` to use proper backend authentication to determine the correct
59-
authentication backend for the user. You will need to make sure that
60-
``SignupView.identifier_field`` is set to represent the correct field on the
61-
sign up form to use as the username for credentials. By default the ``username``
62-
field is used (to be consistent with the default username authentication used
63-
for log in.)
64-
65-
If you have a custom need for user credentials passed to the authentication
66-
backends, you may override the behavior using the hookset
67-
``get_user_credentials``.

docs/settings.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,3 @@ Default: ``list(zip(pytz.all_timezones, pytz.all_timezones))``
148148
=====================
149149

150150
See full list in: https://github.com/pinax/django-user-accounts/blob/master/account/language_list.py
151-
152-
``ACCOUNT_USE_AUTH_AUTHENTICATE``
153-
=================================
154-
155-
Default: ``False``

0 commit comments

Comments
 (0)