aboutsummaryrefslogtreecommitdiffstats
path: root/pysite
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2018-03-13 00:22:22 +0100
committerGravatar Leon Sandøy <[email protected]>2018-03-13 00:22:22 +0100
commitfaacf18d81db171cf5e7a4dc2fd5e6f0199410fc (patch)
tree1cb1e9525cfe891b3316a77b2a066e002551eacc /pysite
parentremoves gunicorn config as it is no longer being used (#39) (diff)
Minor bugfix to allow tag.delete to return success as False if the tag doesn't exist
Diffstat (limited to 'pysite')
-rw-r--r--pysite/views/api/bot/tags.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/pysite/views/api/bot/tags.py b/pysite/views/api/bot/tags.py
index 9db926f4..241f7686 100644
--- a/pysite/views/api/bot/tags.py
+++ b/pysite/views/api/bot/tags.py
@@ -107,10 +107,13 @@ class TagsView(APIView, DBMixin):
json = data[0]
tag_name = json.get("tag_name")
+ tag_exists = self.db.get(self.table_name, tag_name)
- self.db.delete(
- self.table_name,
- tag_name
- )
+ if tag_exists:
+ self.db.delete(
+ self.table_name,
+ tag_name
+ )
+ return jsonify({"success": True})
- return jsonify({"success": True})
+ return jsonify({"success": False})