Skip to content

Commit a8cd72e

Browse files
committed
Fix multiple groups
1 parent f1c6b36 commit a8cd72e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

brood/actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,14 +719,14 @@ def get_current_user_with_groups_by_token(
719719
objects = query.all()
720720
if len(objects) == 0:
721721
raise TokenNotFound("Token not found")
722-
if len(objects) > 1:
723-
logger.error(f"Found several users with token id: {token}")
724-
raise Exception("Found several users")
725722

726723
active_token = objects[0][0]
727724
user = objects[0][1]
728725
groups = []
729726
for object in objects:
727+
if object[1].id != user.id:
728+
logger.error(f"Found several users with token id: {token}")
729+
raise Exception("Found several users")
730730
# Skip if there are no groups
731731
if object[2] is None:
732732
continue

0 commit comments

Comments
 (0)