Skip to content

Commit

Permalink
adding addtional logging for project uuid upon deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Grafft committed Nov 29, 2023
1 parent dc786e9 commit 74232d3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions geoapi/routes/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,15 @@ def get(self, projectId: int):
@project_admin_or_creator_permissions
def delete(self, projectId: int):
u = request.current_user
logger.info("Delete project:{} for user:{}".format(projectId,
u.username))
return ProjectsService.delete(db_session, u, projectId)
# Retrieve the project using the projectId to get its UUID
project = ProjectsService.get(db_session, project_id=projectId, user=u)
# Check if the project exists and log the information including the UUID
if project:
logger.info("Delete project:{} with UUID:{} for user:{}".format(
projectId, project.uuid, u.username))
return ProjectsService.delete(db_session, u, projectId)
else:
abort(404, "Project not found")

@api.doc(id="updateProject",
description="Update metadata about a project")
Expand Down

0 comments on commit 74232d3

Please sign in to comment.