From d3cf5c9311146c8b8fd0f1d84b078bd87fd187e7 Mon Sep 17 00:00:00 2001 From: Andy Kittner Date: Sat, 19 May 2012 10:33:59 +0200 Subject: [PATCH] Correctly handle first time passwords (#194) - Save User object after setting the password - Only generate first time password if none was explicitly specified --- openslides/participant/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openslides/participant/views.py b/openslides/participant/views.py index f632a92c0..d74bb3751 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -156,8 +156,10 @@ def edit(request, user_id=None): profile = profileform.save(commit=False) profile.user = user if user_id is None: - profile.firstpassword = gen_password() + 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.'))