Skip to content

Commit

Permalink
extra check if extra_email_context is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
ghalebkhaled committed Apr 24, 2018
1 parent f38ea7d commit 687a133
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions accountsplus/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def password_reset(request,
# We set this always in the middleware to the preferred language of the user
if request.method == 'POST':
email = request.POST['email']
extra_email_context = extra_email_context or {}
try:
user = User.objects.get(email=email)
extra_email_context['email_lang'] = user.preferred_language or request.LANGUAGE_CODE
Expand Down

0 comments on commit 687a133

Please sign in to comment.