fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Uglier but supported by Chrome
[wolnelektury.git]
/
apps
/
polls
/
models.py
diff --git
a/apps/polls/models.py
b/apps/polls/models.py
index
f73b970
..
8e35668
100644
(file)
--- a/
apps/polls/models.py
+++ b/
apps/polls/models.py
@@
-37,7
+37,7
@@
class Poll(models.Model):
return self.items.all().aggregate(models.Sum('vote_count'))['vote_count__sum']
def voted(self, session):
return self.items.all().aggregate(models.Sum('vote_count'))['vote_count__sum']
def voted(self, session):
- return self.id in session.get(USED_POLLS_KEY,
set()
)
+ return self.id in session.get(USED_POLLS_KEY,
[]
)
class PollItem(models.Model):
class PollItem(models.Model):
@@
-60,5
+60,5
@@
class PollItem(models.Model):
def vote(self, session):
self.vote_count = self.vote_count + 1
self.save()
def vote(self, session):
self.vote_count = self.vote_count + 1
self.save()
- session.setdefault(USED_POLLS_KEY,
set()).ad
d(self.poll.id)
+ session.setdefault(USED_POLLS_KEY,
[]).appen
d(self.poll.id)
session.save()
session.save()