Tries to fix: https://pagure.io/pagure/issue/541
It's one idea, but I think we can make it simpler.
If someone lost their password, they'll go to 'lost password' and we send them an email.
If they lost this email, they can go back to 'lost password' and we re-sent them the email, while currently, we prevent re-sending that email.
So we could just adjust this part here: https://pagure.io/fork/vivekanand1101/pagure/blob/email-again/f/pagure/ui/login.py#_182 (until line 188)
One thing we could add is to check when was the user last updated and block sending the email if there is less than say 2 or 3 minutes.
We need to check, but this might have to be utcnow().
utcnow()
Maybe more something along the lines of: An email was sent to you less than 3 minutes ago, did you check your spam folder? Otherwise, try again after some time.
An email was sent to you less than 3 minutes ago, did you check your spam folder? Otherwise, try again after some time
What do you think?
It should be utcnow()
No, actually we are using sa.func.now() throughout in the models. so, it should be now().
You're right, I'm going to merge this one manually to keep the history linear.
Thanks!
While looking at the unit-tests, it seems it user_obj.updated_on is using UTC :-/
user_obj.updated_on