Skip to content

Commit

Permalink
Org delete endpoint err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
bsatoriu committed Sep 4, 2024
1 parent 8ffb73f commit 34bba35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/endpoints/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def delete(self, org_id):
"""

org = db.session.query(Organization_db).filter_by(id=org_id).first()
org_name = org.name

if org is None:
return err_response(msg="Organization does not exist")
Expand All @@ -230,7 +231,7 @@ def delete(self, org_id):
db.session.query(Organization_db).filter_by(id=org_id).delete()
db.session.commit()

return {"code": status.HTTP_200_OK, "message": "Successfully deleted {}.".format(org)}
return {"code": status.HTTP_200_OK, "message": "Successfully deleted {}.".format(org_name)}


@ns.route('/<int:org_id>/membership')
Expand Down

0 comments on commit 34bba35

Please sign in to comment.