# Bugfix Payment date invalid
* fixes a bug where validation check of payment 'due' has not been triggered properly
This commit is contained in:
parent
d9046eb2b9
commit
5f45db6716
@ -77,8 +77,11 @@ class NewPaymentForm(BaseModalForm):
|
||||
is_valid (bool): True if valid, False otherwise
|
||||
"""
|
||||
super_valid = super().is_valid()
|
||||
date = self.cleaned_data["due"]
|
||||
comment = self.cleaned_data["comment"] or None
|
||||
if not super_valid:
|
||||
return super_valid
|
||||
|
||||
date = self.cleaned_data.get("due", None)
|
||||
comment = self.cleaned_data.get("comment", None)
|
||||
if not date and not comment:
|
||||
# At least one needs to be set!
|
||||
self.add_error(
|
||||
|
Loading…
Reference in New Issue
Block a user