Skip to content

Commit

Permalink
fix: previous_values_are_unequal
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jun 20, 2024
1 parent 8e7e28d commit f104a4e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions codeforlife/models/signals/pre_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ def previous_values_are_unequal(instance: _.AnyModel, fields: t.Set[str]):
"""
# pylint: enable=line-too-long

return check_previous_values(
instance,
{
field: lambda previous_value: (
previous_value != getattr(instance, field)
)
for field in fields
},
get_previous_value = _generate_get_previous_value(instance)

return all(
get_previous_value(field) != getattr(instance, field)
for field in fields
)

0 comments on commit f104a4e

Please sign in to comment.