Skip to content

Commit

Permalink
refactor: make getattr() not crash
Browse files Browse the repository at this point in the history
  • Loading branch information
winged authored Jan 9, 2025
1 parent dc0e4eb commit cb0b7ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caluma/caluma_form/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def remove_calc_dependents(sender, instance, **kwargs):
@receiver(post_save, sender=models.Question)
@disable_raw
@filter_events(lambda instance: instance.type == models.Question.TYPE_CALCULATED_FLOAT)
@filter_events(lambda instance: getattr(instance, "calc_expression_changed"))
@filter_events(lambda instance: getattr(instance, "calc_expression_changed", False))
def update_calc_from_question(sender, instance, created, update_fields, **kwargs):
for document in models.Document.objects.filter(form__questions=instance):
update_or_create_calc_answer(instance, document)
Expand Down

0 comments on commit cb0b7ab

Please sign in to comment.