Skip to content
Snippets Groups Projects
Commit ada398c9 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add separate form for an additional survey after registration, advances #26.

Moved init code from registration ofmr, reusing it to add the same
fields to the registration form. Consider moving to a form set instead.
parent 2727a6eb
No related branches found
No related tags found
1 merge request!20Add dynamic fields to event registration
......@@ -134,6 +134,12 @@ class EventRegisterForm(forms.Form):
self.fields['voucher_code'].validators.append(is_valid_voucher_for(project.cn))
EventAdditionSurveyForm.__init__(self, project, *args, **kwargs)
class EventAdditionalSurveyForm(forms.Form):
def __init__(self, project, *args, **kwargs):
super(EventAdditionalSurveyForm, self).__init__(*args, **kwargs)
for field in project.registration_fields:
label, help_text, *choices = field.split('|')
var = re.sub(r'\W|^(?=\d)', '_', label)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment