Use Person.plain_name as token holder names in proxy, and also in the WGAction form, fixes #776.

- Legacy-Id: 3996
This commit is contained in:
Ole Laursen 2012-02-28 18:11:57 +00:00
parent dbf5e6ab84
commit 8723e7f60d
3 changed files with 5 additions and 5 deletions

View file

@ -321,7 +321,7 @@ class InternetDraft(Document):
#token_name = models.CharField(blank=True, max_length=25)
@property
def token_name(self):
return self.ad.name
return self.ad.plain_name()
#token_email = models.CharField(blank=True, max_length=255)
@property

View file

@ -382,7 +382,7 @@ class WorkingGroupActionsTestCaseREDESIGN(django.test.TestCase):
# change
dates = TelechatDate.objects.active()
token_name = Person.objects.get(name="Ad No1").name_parts()[1]
token_name = Person.objects.get(name="Ad No1").plain_name()
old = wga.pk
r = self.client.post(url, dict(status_date=dates[0].date.isoformat(),
token_name=token_name,
@ -433,7 +433,7 @@ class WorkingGroupActionsTestCaseREDESIGN(django.test.TestCase):
wgas_before = WGAction.objects.all().count()
dates = TelechatDate.objects.active()
token_name = Person.objects.get(name="Ad No1").name_parts()[1]
token_name = Person.objects.get(name="Ad No1").plain_name()
r = self.client.post(add_url,
dict(status_date=dates[0].date.isoformat(),
token_name=token_name,

View file

@ -663,7 +663,7 @@ def working_group_actions(request):
context_instance=RequestContext(request))
class EditWGActionForm(forms.ModelForm):
token_name = forms.ChoiceField()
token_name = forms.ChoiceField(required=True)
telechat_date = forms.TypedChoiceField(coerce=lambda x: datetime.datetime.strptime(x, '%Y-%m-%d').date(), empty_value=None, required=False)
class Meta:
@ -674,7 +674,7 @@ class EditWGActionForm(forms.ModelForm):
super(self.__class__, self).__init__(*args, **kwargs)
# token name choices
self.fields['token_name'].choices = [(p.first_name, p.first_name) for p in IESGLogin.active_iesg().order_by('first_name')]
self.fields['token_name'].choices = [("", "(None)")] + [(p.plain_name(), p.plain_name()) for p in IESGLogin.active_iesg().order_by('first_name')]
# telechat choices
dates = TelechatDates.objects.all()[0].dates()