Skip to content

Commit d2df8ca

Browse files
committed
Fixed the manyfold duplicated position names in the position selection drop-down list in the nomcom private index page. Fixes issue ietf-tools#1137.
- Legacy-Id: 6327
1 parent 29eaaa9 commit d2df8ca

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

ietf/nomcom/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ def index(request):
4040
nomcom_list = Group.objects.filter(type__slug='nomcom').order_by('acronym')
4141
for nomcom in nomcom_list:
4242
year = nomcom.acronym[6:]
43-
debug.show('year')
4443
try:
4544
year = int(year)
4645
except ValueError:
4746
year = None
48-
debug.show('year')
4947
nomcom.year = year
5048
nomcom.label = "%s/%s" % (year, year+1)
5149
if year in [ 2005, 2006, 2007, 2008, 2009, 2010 ]:
@@ -60,7 +58,6 @@ def index(request):
6058
nomcom.ann_url = "/ann/nomcom/#%4d" % year
6159
else:
6260
nomcom.ann_url = None
63-
debug.show('nomcom.url')
6461
return render_to_response('nomcom/index.html',
6562
{'nomcom_list': nomcom_list,}, RequestContext(request))
6663

@@ -145,7 +142,7 @@ def private_index(request, year):
145142

146143
stats = all_nominee_positions.values('position__name', 'position__id').annotate(total=Count('position'))
147144
states = list(NomineePositionState.objects.values('slug', 'name')) + [{'slug': questionnaire_state, 'name': u'Questionnaire'}]
148-
positions = all_nominee_positions.values('position__name', 'position__id').distinct()
145+
positions = set([ n.position for n in all_nominee_positions.order_by('position__name') ])
149146
for s in stats:
150147
for state in states:
151148
if state['slug'] == questionnaire_state:

ietf/templates/nomcom/private_index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ <h3>Select Filters</h3>
6161
<select name="position">
6262
<option value="">All</option>
6363
{% for position in positions %}
64-
<option value="{{ position.position__id }}"
65-
{% ifequal position.position__id selected_position %}selected="selected"{% endifequal%}>
66-
{{ position.position__name }}
64+
<option value="{{ position.id }}"
65+
{% ifequal position.id selected_position %}selected="selected"{% endifequal%}>
66+
{{ position.name }}
6767
</option>
6868
{% endfor %}
6969
</select>

0 commit comments

Comments
 (0)