membershipworks: Reject event invoice form if an invoice already exists
This commit is contained in:
parent
0f1640a5d6
commit
b1daa21e2c
@ -22,6 +22,9 @@ class EventInvoiceForm(forms.Form):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def clean(self):
|
||||
if hasattr(self.event, "invoice") is not None:
|
||||
raise forms.ValidationError("An invoice was already created!")
|
||||
|
||||
if self.event.total_due_to_instructor is None:
|
||||
raise forms.ValidationError(
|
||||
"Event missing required information to generate invoice"
|
||||
|
Loading…
Reference in New Issue
Block a user