mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-14 02:56:24 +01:00
Extending Choices for Questions in hrapplications to Allow Multiselect (#911)
An additional field at the question level defines whether the choices for the question are multi-select or not. The template will render the choices with radio buttons or checkboxes depending on multi-select. Multiple selected choices are saved with a line break between them.
This commit is contained in:
@@ -62,8 +62,8 @@ def hr_application_create_view(request, form_id=None):
|
||||
application.save()
|
||||
for question in app_form.questions.all():
|
||||
response = ApplicationResponse(question=question, application=application)
|
||||
response.answer = request.POST.get(str(question.pk),
|
||||
"Failed to retrieve answer provided by applicant.")
|
||||
response.answer = "\n".join(request.POST.getlist(str(question.pk),
|
||||
""))
|
||||
response.save()
|
||||
logger.info("%s created %s" % (request.user, application))
|
||||
return redirect('hrapplications:view')
|
||||
|
||||
Reference in New Issue
Block a user