Skip to content

Commit

Permalink
Get groups of users by project
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanBoronat committed Nov 9, 2017
1 parent 98a7ad8 commit b5bb622
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/projects/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
url(r'^$', views.projects),
url(r'^(?P<project_id>\w+)/?$', views.projects),

# Crystal Project Users
# Crystal Project Users & Groups
url(r'^(?P<project_id>\w+)/users/?$', views.project_users_list),
url(r'^(?P<project_id>\w+)/groups/?$', views.project_groups_list),

]
8 changes: 8 additions & 0 deletions api/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,11 @@ def project_users_list(request, project_id):

return JSONResponse(user_list, status=status.HTTP_200_OK)
return JSONResponse('Method ' + str(request.method) + ' not allowed.', status=status.HTTP_405_METHOD_NOT_ALLOWED)


@csrf_exempt
def project_groups_list(request, project_id):
if request.method == 'GET':
groups_list = list()
return JSONResponse(groups_list, status=status.HTTP_200_OK)
return JSONResponse('Method ' + str(request.method) + ' not allowed.', status=status.HTTP_405_METHOD_NOT_ALLOWED)

0 comments on commit b5bb622

Please sign in to comment.