Skip to content
This repository has been archived by the owner on Oct 16, 2018. It is now read-only.

Commit

Permalink
Merge branch 'release/0.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
hedleyroos committed Dec 12, 2013
2 parents 6bd548a + fbb365e commit 24bc905
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
@@ -1,6 +1,10 @@
Changelog
=========

0.1.2
-----
#. Performance improvements.

0.1.1
-----
#. Add caching to detail and widget templates.
Expand Down
7 changes: 4 additions & 3 deletions poll/models.py
Expand Up @@ -48,10 +48,11 @@ def can_vote_on_poll(self, request):
object_id__in=[o.id for o in self.polloption_set.all()],
token=request.secretballot_token
)
if votes.count() == 0:
return True, 'can_vote'
else:
if votes.exists():
return False, 'voted'
else:
return True, 'can_vote'


@property
def vote_count(self):
Expand Down
4 changes: 2 additions & 2 deletions poll/templatetags/poll_tags.py
Expand Up @@ -17,8 +17,8 @@ def poll_detail(context, obj):
'object': obj,
'can_vote_on_poll': can_vote_on_poll,
'reason': reason
})
if not context.has_key('form'):
})
if can_vote_on_poll and not context.has_key('form'):
context['form'] = PollVoteForm(request=context['request'], poll=obj)
return context

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -2,7 +2,7 @@

setup(
name='jmbo-poll',
version='0.1.1',
version='0.1.2',
description='Polling app for Jmbo.',
long_description=open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(),
author='Praekelt Foundation',
Expand Down

0 comments on commit 24bc905

Please sign in to comment.