Skip to content

Commit

Permalink
Syntax refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
rnovak338 committed Dec 6, 2024
1 parent 241b63b commit 53fe923
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/support/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def event(self, obj):
_json = json.loads(obj.change_message)

# The LogEntry has recorded changes.
if len(_json) > 0:
if _json:
_json = _json[0]
if "changed" in _json:
res = "Updated\n"
Expand All @@ -189,7 +189,7 @@ def content(self, obj):
_json = json.loads(obj.change_message)

# The LogEntry has recorded changes.
if len(_json) > 0:
if _json:
_json = _json[0]
if "content" in _json:
return _json["content"]
Expand All @@ -216,7 +216,7 @@ def add_custom_field_to_log(sender, instance, created, **kwargs):
# update content of record after save occurred.
change_message_json = json.loads(instance.change_message)

if len(change_message_json) > 0:
if change_message_json:
if model_class == UserPermission:
change_message_json[0]["content"] = list(
qset.values("email", "permission__slug")
Expand Down

0 comments on commit 53fe923

Please sign in to comment.