Skip to content

Commit 81e8192

Browse files
bmispelonwes-otf
authored andcommitted
Fix crash when creating a Fund without projects enabled
1 parent febd3c8 commit 81e8192

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hypha/apply/funds/admin_forms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def clean(self):
1818
review_forms = self.formsets["review_forms"]
1919
external_review_forms = self.formsets["external_review_forms"]
2020
determination_forms = self.formsets["determination_forms"]
21-
paf_forms = self.formsets["approval_forms"]
2221
number_of_stages = len(workflow.stages)
2322

2423
self.validate_application_forms(workflow, application_forms)
@@ -33,7 +32,10 @@ def clean(self):
3332
self.validate_stages_equal_forms(
3433
workflow, determination_forms, form_type="Determination form"
3534
)
36-
self.validate_paf_form(paf_forms)
35+
36+
if settings.PROJECTS_ENABLED:
37+
paf_forms = self.formsets["approval_forms"]
38+
self.validate_paf_form(paf_forms)
3739

3840
return cleaned_data
3941

0 commit comments

Comments
 (0)