Skip to content

Commit

Permalink
Upgrade to Django 2.2
Browse files Browse the repository at this point in the history
Primarily fix password reset internals
  • Loading branch information
Almad committed Mar 2, 2024
1 parent 6263904 commit 05e9b10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ddcz/forms/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ def get_users(self, email):
"""

user_profiles = UserProfile.objects.filter(email__iexact=email)
users = []

# Allow resetting password of users that were not migrated yet
# This is the only moment beside login that supports migration
for up in user_profiles:
if not up.user:
migrate_user(profile=up)
if up.user and up.user.is_active:
user = up.user
# This is a bit hacky as we rely on Django not to save the changed email field,
# however it's good enough hack to make emails to be sent for now.
# Reconsider email handling once we're fully migrated and on lates Django
user.email = up.email

users = tuple(
list(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django>=2.1.0,<2.2
Django>=2.2.0,<2.3
mysqlclient
gunicorn
sqlparse
Expand Down

0 comments on commit 05e9b10

Please sign in to comment.