Use gen_password() for new user objects created via user or application import.
This commit is contained in:
parent
d54afd7ad6
commit
528b49da99
@ -34,7 +34,7 @@ from openslides.utils.utils import template, permission_required, \
|
||||
from openslides.utils.pdf import print_application, print_application_poll
|
||||
from openslides.system.api import config_get
|
||||
|
||||
from openslides.participant.api import gen_username
|
||||
from openslides.participant.api import gen_username, gen_password
|
||||
|
||||
@permission_required('application.can_see_application')
|
||||
@template('application/overview.html')
|
||||
@ -492,6 +492,8 @@ def application_import(request):
|
||||
profile.committee = ''
|
||||
profile.gender = 'none'
|
||||
profile.type = 'guest'
|
||||
profile.firstpassword = gen_password()
|
||||
profile.user.set_password(profile.firstpassword)
|
||||
profile.save()
|
||||
users_generated += 1
|
||||
# create / modify the application
|
||||
|
@ -322,7 +322,6 @@ def user_import(request):
|
||||
user.last_name = last_name
|
||||
user.first_name = first_name
|
||||
user.username = gen_username(first_name, last_name)
|
||||
#user.set_password("%s%s" % (user.first_name, user.last_name))
|
||||
#user.email = email
|
||||
user.save()
|
||||
profile = Profile()
|
||||
@ -331,6 +330,8 @@ def user_import(request):
|
||||
profile.group = group
|
||||
profile.type = type
|
||||
profile.committee = committee
|
||||
profile.firstpassword = gen_password()
|
||||
profile.user.set_password(profile.firstpassword)
|
||||
profile.save()
|
||||
|
||||
if type == 'delegate':
|
||||
|
Loading…
Reference in New Issue
Block a user