Bug fix: users loose their project groups after getting role.

The badger service erased the user's groups when assigning subscriber
group membership.
This commit is contained in:
2016-07-06 12:35:16 +02:00
parent 40b29d7d40
commit 57e2f01153
2 changed files with 28 additions and 1 deletions

View File

@@ -80,7 +80,7 @@ def badger():
return 'Role not allowed', 403
# Fetch the user
db_user = users_coll.find_one({'email': user_email}, projection={'roles': 1})
db_user = users_coll.find_one({'email': user_email}, projection={'roles': 1, 'groups': 1})
if db_user is None:
log.warning('badger(%s, %s, %s): user not found', action, user_email, role)
return 'User not found', 404