Skip to content

Commit

Permalink
TP2000-1238 Fix AttributeError raised when editing a regulation (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalecannon authored Feb 28, 2024
1 parent ad0ff0c commit ac9b21e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions regulations/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,14 @@ def save(self, commit=True):
)

for measure in self.instance.measure_set.current():
terminating_regulation = (
new_regulation
if measure.terminating_regulation == instance
else measure.terminating_regulation
)
measure.new_version(
generating_regulation=new_regulation,
terminating_regulation=new_regulation
if measure.terminating_regulation.regulation_id
== instance.regulation_id
else measure.terminating_regulation,
terminating_regulation=terminating_regulation,
workbasket=workbasket,
)

Expand Down

0 comments on commit ac9b21e

Please sign in to comment.