Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix(projects): ignore signal when loading a fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
trowik committed Dec 8, 2022
1 parent 293757d commit 21e5dd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions timed/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ def update_billed_flag_on_reports(sender, instance, **kwargs):
The billed flag should primarily be set in frontend.
This is only a quicker way for the accountants to update all reports at once.
"""
# ignore signal when loading a fixture
if kwargs.get("raw", False): # pragma: no cover
return

# check whether the project was created or is being updated
if instance.pk:
if instance.billed != Project.objects.get(id=instance.id).billed:
Expand Down

0 comments on commit 21e5dd7

Please sign in to comment.