Skip to content

Commit

Permalink
Merge pull request #357 from MerginMaps/gh#2711-not-found-message-col…
Browse files Browse the repository at this point in the history
…laborators

Remove default detail message from 404 in collaborators
  • Loading branch information
MarcelGeo authored Jan 16, 2025
2 parents 06520e1 + a7bd2fe commit ce515e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/mergin/sync/public_api_v2_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def update_project_collaborator(id, user_id):
project = require_project_by_uuid(id, ProjectPermissions.Update)
user = User.query.filter_by(id=user_id, active=True).first_or_404()
if not project.get_role(user_id):
abort(404, "User is not a project member")
abort(404)

project.set_role(user.id, ProjectRole(request.json["role"]))
db.session.commit()
Expand All @@ -126,7 +126,7 @@ def remove_project_collaborator(id, user_id):
"""Remove project collaborator"""
project = require_project_by_uuid(id, ProjectPermissions.Update)
if not project.get_role(user_id):
abort(404, "User is not a project member")
abort(404)

project.unset_role(user_id)
db.session.commit()
Expand Down

0 comments on commit ce515e3

Please sign in to comment.