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")
|
file_field = cleaned_data.get("file_field")
|
||||||
|
|
||||||
# check if resolution exists
|
# check if resolution exists
|
||||||
try:
|
if resolution != "":
|
||||||
Resolution.objects.get(id=resolution)
|
try:
|
||||||
except:
|
Resolution.objects.get(id=resolution)
|
||||||
raise ValidationError(
|
except:
|
||||||
f"Es gibt keinen Beschluss mit dieser ID. (Eingegebene ID: {resolution})"
|
raise ValidationError(
|
||||||
)
|
f"Es gibt keinen Beschluss mit dieser ID. (Eingegebene ID: {resolution})"
|
||||||
|
)
|
||||||
|
|
||||||
# check that amount is valid because invalid amount is a NoneType.
|
# check that amount is valid because invalid amount is a NoneType.
|
||||||
if amount:
|
if amount:
|
||||||
|
|||||||
Reference in New Issue
Block a user