Skip to content

Commit

Permalink
fix bug with preferred section not being displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Jan 12, 2021
1 parent 3048f6c commit 43db216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ephios/plugins/basesignup/signup/section_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def __init__(self, **kwargs):
self.instance.participant,
)
]
if initial := self.instance.data.get("dispatched_section_uuid"):
self.fields["section"].initial = initial
elif preferred_section_uuid := self.instance.data.get("preferred_section_uuid"):
if preferred_section_uuid := self.instance.data.get("preferred_section_uuid"):
self.fields["section"].initial = preferred_section_uuid
self.preferred_section = next(
filter(lambda section: section["uuid"] == preferred_section_uuid, sections), None
)
if initial := self.instance.data.get("dispatched_section_uuid"):
self.fields["section"].initial = initial

def clean(self):
super().clean()
Expand Down

0 comments on commit 43db216

Please sign in to comment.