Skip to content

Commit

Permalink
Enable group stream boxes when in draft mode
Browse files Browse the repository at this point in the history
They are disabled when editing a proposal in general, but in the case of
a draft, the users sometimes need to be able to edit them in order to
finish an application.

This fix may be incomplete, as it does not allow the group forms to have
the full functionality of hiding the followup forms when "No" is
selected, and showing them when "Yes" is selected.

Semi fixes issue #4031
  • Loading branch information
frankduncan authored and frjo committed Nov 7, 2024
1 parent 8f16bd2 commit 7b6aca6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hypha/apply/funds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,10 @@ class that doesn't validate required fields while saving.
)
field_blocks = self.object.get_defined_fields()
for field_block in field_blocks:
if isinstance(field_block.block, GroupToggleBlock):
if (
isinstance(field_block.block, GroupToggleBlock)
and not self.object.is_draft
):
# Disable group toggle field as it is not supported on edit forms.
form_fields[field_block.id].disabled = True
return type(
Expand Down

0 comments on commit 7b6aca6

Please sign in to comment.