Skip to content
Snippets Groups Projects
Commit 979ff24d authored by Felix Schäfer's avatar Felix Schäfer :construction_worker:
Browse files

Only show public registration question for selected items

parent 52851c37
No related branches found
No related tags found
No related merge requests found
...@@ -30,13 +30,17 @@ def add_public_registrations_html_head(sender, request=None, **kwargs): ...@@ -30,13 +30,17 @@ def add_public_registrations_html_head(sender, request=None, **kwargs):
@receiver(question_form_fields, dispatch_uid="public_registration_question") @receiver(question_form_fields, dispatch_uid="public_registration_question")
def add_public_registration_question(sender, **kwargs): def add_public_registration_question(sender, position, **kwargs):
return {'public_registration': forms.CharField( # TODO: This should also filter by items with an attendee
label=_('Public registration'), if str(position.item.pk) in sender.settings.get('public_registrations_items'):
required=False, return {'public_registration': forms.CharField(
help_text=sender.settings.get('public_registration_field_help_text', as_type=LazyI18nString), label=_('Public registration'),
widget=forms.CheckboxInput(), required=False,
)} help_text=sender.settings.get('public_registrations_field_help_text', as_type=LazyI18nString),
widget=forms.CheckboxInput(),
)}
else:
return {}
@receiver(signal=front_page_bottom, dispatch_uid="public_registrations_table") @receiver(signal=front_page_bottom, dispatch_uid="public_registrations_table")
......
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