From eecae3850d7a840d7cf319025cfa37b4adbcf1a2 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 15 Nov 2024 16:56:38 +0200 Subject: [PATCH] give error when tags dont actually get changed --- files/routes/asset_submissions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index 7b25b00db..2d5ae858a 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -602,9 +602,11 @@ def update_emoji(v): if tags and existing.tags != tags: if not tags_regex.fullmatch(tags): stop(400, "Invalid tags!") - existing.tags += f" {tags}" - existing.tags = delete_unnecessary_tags(existing.tags, existing.name) - updated = True + new_tags = f"{existing.tags} {tags}" + new_tags = delete_unnecessary_tags(new_tags, existing.name) + if new_tags != existing.tags: + existing.tags = new_tags + updated = True if nsfw: nsfw = (nsfw == 'NSFW')