# Bugfix NewCompensationForm
* fixes bug where a form error would trigger a wrong error warning
This commit is contained in:
parent
a86d86b731
commit
ed5d571704
@ -171,8 +171,8 @@ class NewCompensationForm(AbstractCompensationForm,
|
||||
def is_valid(self):
|
||||
valid = super().is_valid()
|
||||
intervention = self.cleaned_data.get("intervention", None)
|
||||
valid &= not intervention.is_recorded
|
||||
if not valid:
|
||||
if intervention.is_recorded:
|
||||
valid &= False
|
||||
self.add_error(
|
||||
"intervention",
|
||||
_("This intervention is currently recorded. You cannot add further compensations as long as it is recorded.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user