pycon
pycon copied to clipboard
Replace "Need" Select fields with mandatory Yes/No radio buttons in Grant form
The Grant model contains a few Boolean fields that indicate various needs of the applicants. These fields are:
needs_funds_for_travel = models.BooleanField(_("Needs funds for travel"))
need_visa = models.BooleanField(_("Need visa/invitation letter?"), default=False)
need_accommodation = models.BooleanField(_("Need accommodation"), default=False)
Currently, these fields are implemented as select fields with default values set to False
on the frontend form. This setup creates ambiguity as it's unclear whether users genuinely do not need these funds or simply do not pay attention in selecting the correct option.
In the frontend, we need to replace the select fields with two mandatory radio buttons for "Yes" and "No". Ensure that the form raises an error if the user fails to select an option. In the backend, remove the default value.