Fix bug for non-transparent sondages
authorRogdham <contact@rogdham.net>
Thu, 30 Aug 2012 16:29:28 +0000 (18:29 +0200)
committerRogdham <contact@rogdham.net>
Thu, 30 Aug 2012 16:29:28 +0000 (18:29 +0200)
Bug detail: when user is not logged, an exception was raised when she was
looking to a non-transparent vote.

templates/vote.html

index cbe59f4..e3ecbfc 100644 (file)
@@ -22,7 +22,7 @@
 
   <tbody>
   {% for user in users %}
-  {% if vote.is_transparent or user.userid == session.user.id %}
+  {% if vote.is_transparent or (session.user and user.userid == session.user.id )%}
     <tr>
       <th>{% if 'user' in session and user.userid == session.user.id %}<i class="icon-user"></i>{% endif %} {{ user.username }}</th>
       {% for choice in choices %}