-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TP2000-1660: Add staleness checking to missing measures check #1400
base: master
Are you sure you want to change the base?
Conversation
{% else %} | ||
|
||
|
||
{% if missing_measures_check.hash != workbasket.commodity_measure_changes_hash %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conditional may get skipped even if the hash has changed if the last check was successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah you're right. I'll see if I can rewrite this template to be a bit less confusing
{% else %} | ||
|
||
|
||
{% if missing_measures_check.hash != workbasket.commodity_measure_changes_hash %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might this staleness check be useful as a boolean property?
changes = [ | ||
item | ||
for item in self.tracked_models.all().order_by("pk") | ||
if isinstance(item, GoodsNomenclature) or isinstance(item, Measure) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queryset here and in def has_commodities()
could be filtered for subclasses:
qs = self.tracked_models.filter(
Q(instance_of=GoodsNomenclature) | Q(instance_of=Measure)
).order_by("pk")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's much neater thank you!
TP2000-1660: Add staleness checking to missing measures check
Why
What
Checklist