Skip to content

Commit

Permalink
fix: remove redundant exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Laban254 committed Aug 7, 2024
1 parent cd42010 commit 2fbcfc1
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions api/v1/routes/activity_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,9 @@ async def delete_activity_log(
current_user: User = Depends(user_service.get_current_super_admin)
):
"""Endpoint to delete an activity log by its ID"""

try:
activity_log_service.delete_activity_log_by_id(db, log_id)
return success_response(
status_code=status.HTTP_200_OK,
message=f"Activity log with ID {log_id} deleted successfully"
)
except HTTPException as e:
raise e
except Exception as e:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"An unexpected error occurred: {str(e)}"
)

activity_log_service.delete_activity_log_by_id(db, log_id)
return success_response(
status_code=status.HTTP_200_OK,
message=f"Activity log with ID {log_id} deleted successfully"
)

0 comments on commit 2fbcfc1

Please sign in to comment.