Merged [3166] from rjsparks@nostrum.com:
Simple changes to EditInfoForm field initialization
- Legacy-Id: 3248
Note: SVN reference [3166] has been migrated to Git commit eef5028182
This commit is contained in:
commit
99e3b7ff22
|
@ -85,7 +85,7 @@ def dehtmlify_textarea_text(s):
|
|||
class EditInfoForm(forms.Form):
|
||||
intended_status = forms.ModelChoiceField(IDIntendedStatus.objects.all(), empty_label=None, required=True)
|
||||
status_date = forms.DateField(required=False, help_text="Format is YYYY-MM-DD")
|
||||
area_acronym = forms.ModelChoiceField(Area.active_areas(), required=True, empty_label=None)
|
||||
area_acronym = forms.ModelChoiceField(Area.active_areas(), required=True, empty_label='None Selected')
|
||||
via_rfc_editor = forms.BooleanField(required=False, label="Via IRTF or RFC Editor")
|
||||
job_owner = forms.ModelChoiceField(IESGLogin.objects.filter(user_level__in=(IESGLogin.AD_LEVEL, IESGLogin.INACTIVE_AD_LEVEL)).order_by('user_level', 'last_name'), label="Responsible AD", empty_label=None, required=True)
|
||||
state_change_notice_to = forms.CharField(max_length=255, label="Notice emails", help_text="Separate email addresses with commas", required=False)
|
||||
|
@ -99,9 +99,9 @@ class EditInfoForm(forms.Form):
|
|||
super(self.__class__, self).__init__(*args, **kwargs)
|
||||
|
||||
job_owners = IESGLogin.objects.in_bulk([t[0] for t in self.fields['job_owner'].choices])
|
||||
choices = [("","None Selected"), ]
|
||||
if old_ads:
|
||||
# separate active ADs from inactive
|
||||
choices = []
|
||||
separated = False
|
||||
for t in self.fields['job_owner'].choices:
|
||||
if job_owners[t[0]].user_level != IESGLogin.AD_LEVEL and not separated:
|
||||
|
@ -111,9 +111,10 @@ class EditInfoForm(forms.Form):
|
|||
self.fields['job_owner'].choices = choices
|
||||
else:
|
||||
# remove old ones
|
||||
self.fields['job_owner'].choices = filter(
|
||||
lambda t: job_owners[t[0]].user_level == IESGLogin.AD_LEVEL,
|
||||
self.fields['job_owner'].choices)
|
||||
for t in self.fields['job_owner'].choices:
|
||||
if job_owners[t[0]].user_level==IESGLogin.AD_LEVEL:
|
||||
choices.append(t)
|
||||
self.fields['job_owner'].choices = choices
|
||||
|
||||
# telechat choices
|
||||
dates = TelechatDates.objects.all()[0].dates()
|
||||
|
@ -127,9 +128,9 @@ class EditInfoForm(forms.Form):
|
|||
|
||||
self.fields['telechat_date'].choices = choices
|
||||
|
||||
if kwargs['initial']['area_acronym'] == Acronym.INDIVIDUAL_SUBMITTER:
|
||||
# default to "gen"
|
||||
kwargs['initial']['area_acronym'] = 1008
|
||||
# if kwargs['initial']['area_acronym'] == Acronym.INDIVIDUAL_SUBMITTER:
|
||||
# # default to "gen"
|
||||
# kwargs['initial']['area_acronym'] = 1008
|
||||
|
||||
# returning item is rendered non-standard
|
||||
self.standard_fields = [x for x in self.visible_fields() if x.name not in ('returning_item',)]
|
||||
|
|
Loading…
Reference in a new issue