Permalink
Browse files

No double negative for hiding member presence

And some PEP8
  • Loading branch information...
1 parent 1ddf342 commit 779ae2cf90491b94201e725dc8d4634f1b61546f @MeirKriheli MeirKriheli committed Mar 18, 2013
Showing with 9 additions and 9 deletions.
  1. +8 −8 committees/views.py
  2. +1 −1 templates/committees/committee_member_photos.html
View
@@ -111,29 +111,29 @@ def get_context_data(self, *args, **kwargs):
% {'committee':cm.committee.name,
'date':cm.date_string,
'topic':cm.topics}
- context['description'] = clean_string(context['description']).replace('"','')
- page = self.request.GET.get('page',None)
+ context['description'] = clean_string(context['description']).replace('"', '')
+ page = self.request.GET.get('page', None)
if page:
- context['description'] += _(' page %(page)s') % {'page':page}
+ context['description'] += _(' page %(page)s') % {'page': page}
context['colors'] = colors
parts_lengths = {}
for part in cm.parts.all():
parts_lengths[part.id] = len(part.body)
context['parts_lengths'] = json.dumps(parts_lengths)
context['paginate_by'] = COMMITTEE_PROTOCOL_PAGINATE_BY
- if cm.committee.type=='plenum':
- context['members']=cm.mks_attended.order_by('name')
- context['memer_photos_no_presence']=True
+ if cm.committee.type == 'plenum':
+ context['members'] = cm.mks_attended.order_by('name')
+ context['hide_member_presence'] = True
else:
#get meeting members with presence calculation
meeting_members_ids = set(m.id for m in cm.mks_attended.all())
context['members'] = [m for m in cm.committee.members_by_presence()
- if m.id in meeting_members_ids]
+ if m.id in meeting_members_ids]
+ context['hide_member_presence'] = False
return context
-
@hashnav_method_decorator(login_required)
def post(self, request, **kwargs):
cm = get_object_or_404(CommitteeMeeting, pk=kwargs['pk'])
@@ -1,7 +1,7 @@
{% extends "mks/member_photos.html" %}{% load i18n %}
{% block member_extra %}
{% spaceless %}
-{% if not memer_photos_no_presence %}
+{% if not hide_member_presence %}
<p>{% trans 'Presence:' %} {{member.meetings_percentage}}<span class="muted">%</span></p>
<p>{% trans 'This year:' %} {{member.meetings_percentage_year}}<span class="muted">%</span></p>
{% endif %}

0 comments on commit 779ae2c

Please sign in to comment.