From aa0463dafb38956ec8f875cbc43de49612b13b63 Mon Sep 17 00:00:00 2001 From: rr- Date: Thu, 23 Jun 2016 12:51:44 +0200 Subject: [PATCH] server/tags: improve creation privilege check --- server/szurubooru/api/tag_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/szurubooru/api/tag_api.py b/server/szurubooru/api/tag_api.py index d3f8c7ae..93f4aee1 100644 --- a/server/szurubooru/api/tag_api.py +++ b/server/szurubooru/api/tag_api.py @@ -10,8 +10,9 @@ def _serialize(ctx, tag): def _create_if_needed(tag_names, user): if not tag_names: return - auth.verify_privilege(user, 'tags:create') _existing_tags, new_tags = tags.get_or_create_tags_by_names(tag_names) + if len(new_tags): + auth.verify_privilege(user, 'tags:create') db.session.flush() for tag in new_tags: snapshots.save_entity_creation(tag, user)