Skip to content
Snippets Groups Projects
Commit 86a3ea53 authored by Nik | Klampfradler's avatar Nik | Klampfradler Committed by Tom Teichler
Browse files

Fix duplication of fields in form layout

parent ed442e7c
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ Fixed
~~~~~
* Fix creation on email addresses
* Fix duplication of form fields in layout
`1.1`_
----------
......
......@@ -300,15 +300,18 @@ class RegisterEventAdditional(ExtensibleForm):
def __init__(self, event, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__class__.layout_filled = getattr(self.__class__, "layout_filled", False)
for field in event.linked_group.additional_fields.all():
field_instance = getattr(fields, field.field_type)(
required=field.required,
help_text=field.help_text,
)
self.fields[field.title] = field_instance
node = Fieldset(f"{field.title}", f"{field.title}")
self.add_node_to_layout(node)
if not self.layout_filled:
node = Fieldset(f"{field.title}", f"{field.title}")
self.add_node_to_layout(node)
self.__class__.layout_filled = True
class RegisterEventFinancial(ExtensibleForm):
"""Form to register for an event."""
......
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