-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #750 from OpenSourceBrain/feature/666
Group page and user quotas
- Loading branch information
Showing
25 changed files
with
1,506 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
applications/accounts-api/backend/accounts_api/controllers/groups_controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import connexion | ||
import six | ||
from typing import Dict | ||
from typing import Tuple | ||
from typing import Union | ||
|
||
from accounts_api.models.group import Group # noqa: E501 | ||
from accounts_api.models.user import User # noqa: E501 | ||
from accounts_api import util | ||
|
||
from accounts_api.services import group_service | ||
|
||
def get_group(groupname): # noqa: E501 | ||
"""get_group | ||
# noqa: E501 | ||
:param groupname: | ||
:type groupname: str | ||
:rtype: Union[Group, Tuple[Group, int], Tuple[Group, int, Dict[str, str]] | ||
""" | ||
try: | ||
return group_service.get_group_by_name(groupname) | ||
except group_service.GroupNotFound as e: | ||
return "Group not found", 404 | ||
|
||
|
||
|
||
def get_group_users(groupname): # noqa: E501 | ||
"""get_group_users | ||
# noqa: E501 | ||
:param groupname: | ||
:type groupname: str | ||
:rtype: Union[Group, Tuple[Group, int], Tuple[Group, int, Dict[str, str]] | ||
""" | ||
try: | ||
return group_service.get_group_users(groupname) | ||
except group_service.GroupNotFound as e: | ||
return "Group not found", 404 | ||
|
||
|
||
def update_group(groupname, request_body): # noqa: E501 | ||
"""update_group | ||
# noqa: E501 | ||
:param groupname: | ||
:type groupname: str | ||
:param request_body: | ||
:type request_body: Dict[str, ] | ||
:rtype: Union[User, Tuple[User, int], Tuple[User, int, Dict[str, str]] | ||
""" | ||
return 'do some magic!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.