Skip to content

Commit 0745a1f

Browse files
committed
Use TelechatDate rather than TelechatDates in new form
- Legacy-Id: 3799
1 parent 19150dc commit 0745a1f

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

ietf/idrfc/views_edit.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,12 @@ def __init__(self, *args, **kwargs):
456456
self.fields['ad'].choices = list(choices) + [("", "-------"), (ad_pk, Person.objects.get(pk=ad_pk).name)]
457457

458458
# telechat choices
459-
dates = TelechatDates.objects.all()[0].dates()
459+
dates = [d.date for d in TelechatDate.objects.active().order_by('date')]
460460
init = kwargs['initial']['telechat_date']
461461
if init and init not in dates:
462462
dates.insert(0, init)
463463

464-
choices = [("", "(not on agenda)")]
465-
for d in dates:
466-
choices.append((d, d.strftime("%Y-%m-%d")))
467-
468-
self.fields['telechat_date'].choices = choices
464+
self.fields['telechat_date'].choices = [("", "(not on agenda)")] + [(d, d.strftime("%Y-%m-%d")) for d in dates]
469465

470466
# returning item is rendered non-standard
471467
self.standard_fields = [x for x in self.visible_fields() if x.name not in ('returning_item',)]

0 commit comments

Comments
 (0)