allow creating a bill without resolution
This commit is contained in:
@@ -103,12 +103,13 @@ class BillCreateForm(forms.ModelForm):
|
||||
file_field = cleaned_data.get("file_field")
|
||||
|
||||
# check if resolution exists
|
||||
try:
|
||||
Resolution.objects.get(id=resolution)
|
||||
except:
|
||||
raise ValidationError(
|
||||
f"Es gibt keinen Beschluss mit dieser ID. (Eingegebene ID: {resolution})"
|
||||
)
|
||||
if resolution != "":
|
||||
try:
|
||||
Resolution.objects.get(id=resolution)
|
||||
except:
|
||||
raise ValidationError(
|
||||
f"Es gibt keinen Beschluss mit dieser ID. (Eingegebene ID: {resolution})"
|
||||
)
|
||||
|
||||
# check that amount is valid because invalid amount is a NoneType.
|
||||
if amount:
|
||||
|
||||
Reference in New Issue
Block a user