Commit ef51cef6a0ca832baa1d49e5e8a34b6c0eb99155

Authored by Andrew Buss
1 parent 5c40ced6df
Exists in master

log a user in after resetting their password

Showing 2 changed files with 3 additions and 12 deletions Side-by-side Diff

flashcards/models.py View file @ ef51cef
... ... @@ -18,18 +18,6 @@
18 18 from fields import MaskField
19 19 from cached_property import cached_property
20 20  
21   -
22   -
23   -
24   -
25   -
26   -
27   -
28   -
29   -
30   -
31   -
32   -
33 21 # Hack to fix AbstractUser before subclassing it
34 22  
35 23 AbstractUser._meta.get_field('email')._unique = True
flashcards/views.py View file @ ef51cef
... ... @@ -309,6 +309,9 @@
309 309 if default_token_generator.check_token(user, data['token'].value):
310 310 user.set_password(data['new_password'].value)
311 311 user.save()
  312 + user = authenticate(email=user.email, password=data['new_password'].value)
  313 + auth.login(request, user)
  314 +
312 315 log_event(request)
313 316 else:
314 317 raise ValidationError('Could not verify reset token')