add group by user-import

This commit is contained in:
Oskar Hahn 2011-09-05 10:11:47 +02:00
parent 450190e603
commit 41fbd456d2

View File

@ -266,6 +266,14 @@ def user_import(request):
profile.type = type profile.type = type
profile.committee = committee profile.committee = committee
profile.save() profile.save()
if type == 'delegate':
delegate = Group.objects.get(name='Delegierte')
user.groups.add(delegate)
else:
observer = Group.objects.get(name='Beobachter')
user.groups.add(observer)
messages.success(request, _('%d new participants were successfully imported.') % i) messages.success(request, _('%d new participants were successfully imported.') % i)
else: else:
messages.error(request, _('Please check the form for errors.')) messages.error(request, _('Please check the form for errors.'))