equal
deleted
inserted
replaced
4 |
4 |
5 class RegisterForm(forms.ModelForm): |
5 class RegisterForm(forms.ModelForm): |
6 """ The form that is displayed to user. |
6 """ The form that is displayed to user. |
7 """ |
7 """ |
8 |
8 |
9 topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES) |
9 topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES, required=False) |
10 class Meta: |
10 class Meta: |
11 model = Registrant |
11 model = Registrant |
12 |
12 |
|
13 def clean_topics_interested(self): |
|
14 """ Join the choices using PIPE character and store them. |
|
15 """ |
|
16 |
|
17 topics = self.cleaned_data['topics_interested'] |
|
18 return "|".join(topics) |