Skip to content

Commit d06c688

Browse files
committed
Bug on user field
1 parent 5f6cc75 commit d06c688

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drfpasswordless/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
__title__ = 'drfpasswordless'
4-
__version__ = '1.0.4'
4+
__version__ = '1.0.5'
55
__author__ = 'Aaron Ng'
66
__license__ = 'MIT'
77
__copyright__ = 'Copyright 2017 Aaron Ng'

drfpasswordless/signals.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def update_alias_verification(sender, instance, **kwargs):
4141
Flags a user's email as unverified if they change it.
4242
"""
4343
if isinstance(instance, User):
44+
4445
if instance.id:
45-
user_old = User.objects.get(id=instance.id) # Pre-save object
4646

4747
if api_settings.PASSWORDLESS_USER_MARK_EMAIL_VERIFIED is True:
4848
"""
@@ -53,7 +53,7 @@ def update_alias_verification(sender, instance, **kwargs):
5353

5454
# Verify that this is an existing instance and not a new one.
5555
try:
56-
56+
user_old = User.objects.get(id=instance.id) # Pre-save object
5757
instance_email = getattr(instance, email_field) # Incoming Email
5858
old_email = getattr(user_old, email_field) # Pre-save object email
5959

@@ -74,6 +74,7 @@ def update_alias_verification(sender, instance, **kwargs):
7474

7575
# Verify that this is an existing instance and not a new one.
7676
try:
77+
user_old = User.objects.get(id=instance.id) # Pre-save object
7778
instance_mobile = getattr(instance, mobile_field) # Incoming mobile
7879
old_mobile = getattr(user_old, mobile_field) # Pre-save object mobile
7980

0 commit comments

Comments
 (0)