Correctly handle first time passwords (#194)
- Save User object after setting the password - Only generate first time password if none was explicitly specified
This commit is contained in:
parent
3f4119f182
commit
d3cf5c9311
@ -156,8 +156,10 @@ def edit(request, user_id=None):
|
||||
profile = profileform.save(commit=False)
|
||||
profile.user = user
|
||||
if user_id is None:
|
||||
if not profile.firstpassword:
|
||||
profile.firstpassword = gen_password()
|
||||
profile.user.set_password(profile.firstpassword)
|
||||
profile.user.save()
|
||||
profile.save()
|
||||
if user_id is None:
|
||||
messages.success(request, _('New participant was successfully created.'))
|
||||
|
Loading…
Reference in New Issue
Block a user