Commit acaa24de authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Fix trace if tags field is empty

parent 29f09016
Pipeline #2875 passed with stage
in 13 seconds
......@@ -363,7 +363,7 @@ class ExtDocApplication(ExtApplication):
return HttpResponse("", status=self.NOT_FOUND)
if self.has_uuid and not attrs.get("uuid") and not o.uuid:
attrs["uuid"] = uuid.uuid4()
if hasattr(o, "tags") and "tags" in attrs:
if hasattr(o, "tags") and attrs.get("tags"):
for t in set(getattr(o, "tags", [])) - (set(attrs.get("tags", []))):
Tag.unregister_tag(t, repr(self.model))
self.logger.info("Unregister Tag: %s" % t)
......
......@@ -482,7 +482,7 @@ class ExtModelApplication(ExtApplication):
except self.model.DoesNotExist:
return HttpResponse("", status=self.NOT_FOUND)
# Tags
if hasattr(o, "tags") and "tags" in attrs:
if hasattr(o, "tags") and attrs.get("tags"):
for t in set(getattr(o, "tags", [])) - (set(attrs.get("tags", []))):
Tag.unregister_tag(t, repr(self.model))
self.logger.info("Unregister Tag: %s" % t)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment