Some more checks on p.a.project.utils.get_admin_group_id()
This commit is contained in:
parent
d2f548faf9
commit
7c5aef033d
@ -28,8 +28,13 @@ def project_total_file_size(project_id):
|
|||||||
|
|
||||||
|
|
||||||
def get_admin_group_id(project_id: ObjectId) -> ObjectId:
|
def get_admin_group_id(project_id: ObjectId) -> ObjectId:
|
||||||
|
assert isinstance(project_id, ObjectId)
|
||||||
|
|
||||||
project = current_app.db('projects').find_one({'_id': project_id},
|
project = current_app.db('projects').find_one({'_id': project_id},
|
||||||
{'permissions': 1})
|
{'permissions': 1})
|
||||||
|
if not project:
|
||||||
|
raise ValueError(f'Project {project_id} does not exist.')
|
||||||
|
|
||||||
# TODO: search through all groups to find the one with the project ID as its name,
|
# TODO: search through all groups to find the one with the project ID as its name,
|
||||||
# or identify "the admin group" in a different way (for example the group with DELETE rights).
|
# or identify "the admin group" in a different way (for example the group with DELETE rights).
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user