From e7d8b8a5ee18d51b06e5292668ac25d86d7f7cbd Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 14 Nov 2011 21:13:13 +0100 Subject: [PATCH] #58: Generate password after user createion automatically. --- openslides/participant/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 0c6875eb5..b8aeede37 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -28,7 +28,7 @@ from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _, ungettext from participant.models import Profile, set_first_user_passwords -from participant.api import gen_username +from participant.api import gen_username, gen_password from participant.forms import UserNewForm, UserEditForm, ProfileForm, UsersettingsForm, UserImportForm, GroupForm, AdminPasswordChangeForm from utils.utils import template, permission_required, gen_confirm_form from utils.pdf import print_userlist, print_passwords @@ -129,6 +129,9 @@ def edit(request, user_id=None): user.save() profile = profileform.save(commit=False) profile.user = user + profile.firstpassword = gen_password() + profile.user.set_password(profile.firstpassword) + user.save() profile.save() if user_id is None: messages.success(request, _('New participant was successfully created.'))