Skip to content

Commit 54589f8

Browse files
committed
Fixed ballot icon/etc. to work with the new auth/authz system
- Legacy-Id: 1878
1 parent 11887ca commit 54589f8

3 files changed

Lines changed: 13 additions & 23 deletions

File tree

ietf/idrfc/templatetags/ballot_icon.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,16 @@
3737
register = template.Library()
3838

3939
def get_user_adid(context):
40-
if 'user' in context and in_group(context['user'], "iesg"):
41-
try:
42-
usermap = context['user'].usermap_set.all()[0]
43-
person = usermap.person
44-
iesglogin = person.iesglogin_set.all()[0]
45-
adId = iesglogin.id
46-
return adId
47-
except:
48-
pass
49-
return None
40+
if 'user' in context and in_group(context['user'], "Area_Director"):
41+
return context['user'].get_profile().iesg_login_id()
42+
else:
43+
return None
5044

5145
def get_user_name(context):
5246
if 'user' in context and context['user'].is_authenticated():
53-
try:
54-
usermap = context['user'].usermap_set.all()[0]
55-
person = usermap.person
56-
if person:
57-
return str(person)
58-
except:
59-
pass
47+
person = context['user'].get_profile().person()
48+
if person:
49+
return str(person)
6050
return None
6151

6252
def render_ballot_icon(context, doc):
@@ -140,7 +130,7 @@ def my_position(doc, user):
140130
user_name = get_user_name({'user':user})
141131
if not user_name:
142132
return None
143-
if not in_group(user, "iesg"):
133+
if not in_group(user, "Area_Director"):
144134
return None
145135
if not doc.in_ietf_process():
146136
return None

ietf/templates/iesg/agenda_documents_row.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{% load ballot_icon %}
3636
{% load ietf_filters %}
3737
<tr
38-
{% if user|in_group:"IESG" %}
38+
{% if user|in_group:"Area_Director" %}
3939
{% if doc|my_position:user|equal:"Discuss" %}style="background:#ffa0a0;"{% endif %}
4040
{% if doc|my_position:user|equal:"Yes" or doc|my_position:user|slugify|equal:"no-objection" %}style="background:#a0ffa0;"{% endif %}
4141
{% if doc|my_position:user|equal:"Abstain" or doc|my_position:user|equal:"Recuse" %}style="background:#c0c0c0;"{% endif %}
@@ -63,4 +63,4 @@
6363
<td class="ballot">{% ballot_icon doc %}</td>
6464
<td class="ad">{% if doc.ad_name %}{{ doc.ad_name|escape }}{% else %}&nbsp;{% endif %}</td>
6565

66-
</tr>
66+
</tr>

ietf/templates/iesg/discusses.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<h1 style="margin-top:0;">IESG Discuss Positions</h1>
4949

50-
{% if user|in_group:"IESG" %}
50+
{% if user|in_group:"Area_Director" %}
5151
<div id="discuss_show1" style="display:block;">
5252
<a href="javascript:show_only_mine()">Show only my discusses</a>
5353
</div>
@@ -61,7 +61,7 @@ <h1 style="margin-top:0;">IESG Discuss Positions</h1>
6161
<table id="discuss_table">
6262
<tr><th class="doc">Document</th><th class="status" colspan="2">Status</th><th class="ad">Area Director</th><th>Discusses</th></tr>
6363
{% for doc in docs %}
64-
<tr {% if user|in_group:"IESG" %}{% if doc|my_position:user|equal:"Discuss" %}
64+
<tr {% if user|in_group:"Area_Director" %}{% if doc|my_position:user|equal:"Discuss" %}
6565
class="discuss_my" {% else %} class="discuss_not_my" {% endif %}{% endif %}>
6666
<td class="doc">
6767
{% if doc.is_rfc_wrapper %}
@@ -109,4 +109,4 @@ <h1 style="margin-top:0;">IESG Discuss Positions</h1>
109109
}
110110
//]]>
111111
</script>
112-
{% endblock %}
112+
{% endblock %}

0 commit comments

Comments
 (0)