Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ietf/secr/sreq/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ietf.meeting.forms import sessiondetailsformset_factory
from ietf.meeting.models import ResourceAssociation, Constraint
from ietf.person.fields import SearchablePersonsField
from ietf.person.models import Person
from ietf.utils.html import clean_text_field
from ietf.utils import log

Expand Down Expand Up @@ -154,10 +155,17 @@ def __init__(self, group, meeting, data=None, *args, **kwargs):
self.fields["resources"].choices = [(x.pk,x.desc) for x in ResourceAssociation.objects.filter(name__used=True).order_by('name__order') ]

if self.hidden:
# replace all the widgets to start...
for key in list(self.fields.keys()):
self.fields[key].widget = forms.HiddenInput()
# re-replace a couple special cases
self.fields['resources'].widget = forms.MultipleHiddenInput()
self.fields['timeranges'].widget = forms.MultipleHiddenInput()
# and entirely replace bethere - no need to support searching if input is hidden
self.fields['bethere'] = forms.ModelMultipleChoiceField(
widget=forms.MultipleHiddenInput, required=False,
queryset=Person.objects.all(),
)

def wg_constraint_fields(self):
"""Iterates over wg constraint fields
Expand Down
5 changes: 2 additions & 3 deletions ietf/secr/sreq/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ def confirm(request, acronym):
return redirect('ietf.secr.sreq.views.main')

session_data = form.data.copy()
if 'bethere' in session_data:
person_id_list = [ id for id in form.data['bethere'].split(',') if id ]
session_data['bethere'] = Person.objects.filter(pk__in=person_id_list)
# use cleaned_data for the 'bethere' field so we get the Person instances
session_data['bethere'] = form.cleaned_data['bethere'] if 'bethere' in form.cleaned_data else []
if session_data.get('session_time_relation'):
session_data['session_time_relation_display'] = dict(Constraint.TIME_RELATION_CHOICES)[session_data['session_time_relation']]
if session_data.get('joint_for_session'):
Expand Down