Fixed participant csv import for group id
- Allowed to add multiple groups in csv group id field (e.g. "3,4") - Fixed bug that group ids > 9 can not be imported. - Updated error message if group id does not exists.
This commit is contained in:
parent
648d5a6ad7
commit
587a3766d2
@ -8,6 +8,12 @@ Version 1.6.1 (unreleased)
|
|||||||
==========================
|
==========================
|
||||||
[https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
|
[https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
|
||||||
|
|
||||||
|
Participants:
|
||||||
|
- Fixed participant csv import for group id:
|
||||||
|
* Allowed to add multiple groups in csv group id field, e.g. "3,4".
|
||||||
|
* Fixed bug that group ids > 9 can not be imported.
|
||||||
|
* Updated error message if group id does not exists.
|
||||||
|
|
||||||
Other:
|
Other:
|
||||||
- Fixed CKEditor stuff (added insertpre plugin and removed unused code)
|
- Fixed CKEditor stuff (added insertpre plugin and removed unused code)
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ Teilnehmer/innen-Namen aus http://de.wikipedia.org/wiki/Otto_Normalverbraucher";
|
|||||||
;"Tädi";"Maali";"female";;3;"Estland";;;;1
|
;"Tädi";"Maali";"female";;3;"Estland";;;;1
|
||||||
;"Maija";"Maikäläinen";"female";;3;"Finnland";;;;1
|
;"Maija";"Maikäläinen";"female";;3;"Finnland";;;;1
|
||||||
;"Jean";"Dupont";"male";;3;"Frankreich";;;;1
|
;"Jean";"Dupont";"male";;3;"Frankreich";;;;1
|
||||||
;"Paul";"Martin";"female";;4;"Frankreich";"Versammlungsleitung";;;1
|
;"Paul";"Martin";"male";;"3,4";"Frankreich";"Versammlungsleitung";;;1
|
||||||
;"Fred";"Bloggs";"male";;3;"Großbritanien";;;;0
|
;"Fred";"Bloggs";"male";;3;"Großbritanien";;;;0
|
||||||
;"John";"Smith";"male";;4;"Großbritanien";"Versammlungsleitung";;;1
|
;"John";"Smith";"male";;4;"Großbritanien";"Versammlungsleitung";;;1
|
||||||
;"Ashok";"Kumar";"male";;3;"Indien";;;;1
|
;"Ashok";"Kumar";"male";;3;"Indien";;;;1
|
||||||
|
|
@ -54,15 +54,13 @@ def import_users(csvfile):
|
|||||||
user.is_active = False
|
user.is_active = False
|
||||||
user.default_password = gen_password()
|
user.default_password = gen_password()
|
||||||
user.save()
|
user.save()
|
||||||
for groupid in groups:
|
for groupid in groups.split(','):
|
||||||
try:
|
try:
|
||||||
if groupid != ",":
|
if groupid and int(groupid):
|
||||||
Group.objects.get(pk=groupid).user_set.add(user)
|
Group.objects.get(pk=groupid).user_set.add(user)
|
||||||
except ValueError:
|
except (Group.DoesNotExist, ValueError):
|
||||||
error_messages.append(_('Ignoring malformed group id in line %d.') % (line_no + 1))
|
error_messages.append(_('Ignoring group id "%(id)s" in line %(line)d which does not exist.') %
|
||||||
continue
|
{'id': groupid, 'line': line_no + 1})
|
||||||
except Group.DoesNotExist:
|
|
||||||
error_messages.append(_('Group id %(id)s does not exists (line %(line)d).') % {'id': groupid, 'line': line_no + 1})
|
|
||||||
continue
|
continue
|
||||||
user.reset_password()
|
user.reset_password()
|
||||||
count_success += 1
|
count_success += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user