Skip to content

Commit

Permalink
Prevent loading related object when updating tags
Browse files Browse the repository at this point in the history
We can simply save by the ID here, we do not need any other data from
the related object.
  • Loading branch information
jchristgit committed Dec 15, 2023
1 parent 14e9005 commit 67329e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydis_site/apps/content/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ def record_tags(tags: list[Tag]) -> None:
# pretend it's previous state is the current state
old_tag = new_tag

if old_tag.sha == new_tag.sha and old_tag.last_commit is not None:
if old_tag.sha == new_tag.sha and old_tag.last_commit_id is not None:
# We still have an up-to-date commit entry
new_tag.last_commit = old_tag.last_commit
new_tag.last_commit_id = old_tag.last_commit_id

new_tag.save()

Expand Down

0 comments on commit 67329e6

Please sign in to comment.