mirror of
https://github.com/alopexc0de/Simple-Bookmarking-Service.git
synced 2024-12-22 14:22:39 +00:00
Add conflict message
This commit is contained in:
parent
433083e28c
commit
34275f9b63
@ -138,10 +138,16 @@ class API:
|
|||||||
Returns a JSON object containing
|
Returns a JSON object containing
|
||||||
everything about the bookmark
|
everything about the bookmark
|
||||||
"""
|
"""
|
||||||
|
conflict_msg = "The new bookmark_id matches one already existing in the database." \
|
||||||
|
"Perhaps you want to delete this bookmark instead?"
|
||||||
|
|
||||||
response.content_type = self.response_type
|
response.content_type = self.response_type
|
||||||
bookmark = self.database.update_bookmark_uri(UUID(bookmark_id), uri)
|
bookmark = self.database.update_bookmark_uri(UUID(bookmark_id), uri)
|
||||||
|
|
||||||
if bookmark == None:
|
if bookmark == None:
|
||||||
return abort(404, "Provided bookmark doesn't exist or has been deleted")
|
return abort(404, "Provided bookmark doesn't exist or has been deleted")
|
||||||
|
|
||||||
|
if not bookmark:
|
||||||
|
return abort(409, conflict_msg)
|
||||||
|
|
||||||
return json.dumps(self._get_bookmark_object(bookmark))
|
return json.dumps(self._get_bookmark_object(bookmark))
|
||||||
|
Loading…
Reference in New Issue
Block a user