|
|
@ -54,10 +54,7 @@ LOG = logging.getLogger('luncho.blueprints.groups') |
|
|
|
@groups.route('<token>/', methods=['GET']) |
|
|
|
@groups.route('<token>/', methods=['GET']) |
|
|
|
def user_groups(token): |
|
|
|
def user_groups(token): |
|
|
|
"""Return a list of the groups the user belongs or it's the owner.""" |
|
|
|
"""Return a list of the groups the user belongs or it's the owner.""" |
|
|
|
(user, error) = user_or_error(token) |
|
|
|
user = user_from_token(token) |
|
|
|
if error: |
|
|
|
|
|
|
|
return error |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
groups = {} |
|
|
|
groups = {} |
|
|
|
for group in user.groups: |
|
|
|
for group in user.groups: |
|
|
|
groups[group.id] = {'id': group.id, |
|
|
|
groups[group.id] = {'id': group.id, |
|
|
|