Skip to content

Commit 55b809f

Browse files
committed
issue564 from meta tracker
Allow user to receive resetted password via the email, which used to receive OTK reset link at the first time
1 parent 0ac2471 commit 55b809f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

roundup/cgi/actions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,9 @@ def handle(self):
698698
"to show up erroneously, please check your email)"))
699699
return
700700

701+
# pull the additional email address if exist
702+
uaddress = otks.get(otk, 'uaddress', default=None)
703+
701704
# re-open the database as "admin"
702705
if self.user != 'admin':
703706
self.client.opendb('admin')
@@ -720,8 +723,11 @@ def handle(self):
720723
return
721724

722725
# user info
723-
address = self.db.user.get(uid, 'address')
724726
name = self.db.user.get(uid, 'username')
727+
if uaddress is None:
728+
address = self.db.user.get(uid, 'address')
729+
else:
730+
address = uaddress
725731

726732
# send the email
727733
tracker_name = self.db.config.TRACKER_NAME
@@ -764,7 +770,7 @@ def handle(self):
764770
otk = ''.join([random.choice(chars) for x in range(32)])
765771
while otks.exists(otk):
766772
otk = ''.join([random.choice(chars) for x in range(32)])
767-
otks.set(otk, uid=uid)
773+
otks.set(otk, uid=uid, uaddress=address)
768774
self.db.commit()
769775

770776
# send the email

0 commit comments

Comments
 (0)