Fixed groups on internal auth

This commit is contained in:
Adolfo Gómez 2013-05-14 11:54:51 +00:00
parent 1c31e01199
commit 6270119d2b

View File

@ -82,10 +82,12 @@ class InternalDBAuth(Authenticator):
# and access will be denied
try:
usr = auth.users.get(name=username, state=State.ACTIVE)
groups = usr.groups.all()
usr.id = None
if usr.real_name.strip() == '':
usr.real_name = usr.name
usr.name = newUsername
usr.groups = groups
usr.save()
except:
logger.exception('Exception')