Commit 1090b19b authored by Christophe Siraut's avatar Christophe Siraut

Fix different anonymous users on different polls with same cookie.

parent 4bcf2101
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-20 17:42+0200\n"
"POT-Creation-Date: 2013-05-21 11:43+0200\n"
"PO-Revision-Date: 2013-05-14 09:32+0200\n"
"Last-Translator: Joan <aseques@gmail.com>\n"
"Language-Team: Catalan <kde-i18n-ca@kde.org>\n"
......@@ -79,14 +79,19 @@ msgstr "El vostre nom"
msgid "You have voted."
msgstr "Heu votat"
#: meetingpoll/views.py:253
#: meetingpoll/views.py:256
msgid "Login let you modify your vote anytime."
msgstr "Entrar us permet modificar el vot sempre."
#: meetingpoll/views.py:261
#: meetingpoll/views.py:262
#, python-format
msgid "%s has voted"
msgstr "%s ha votat"
msgid "%s has voted and can still modify its vote."
msgstr ""
#: meetingpoll/views.py:263 meetingpoll/views.py:277
#, python-format
msgid "Not %s? Click Forget me."
msgstr ""
#: poll/views.py:28
msgid "Thanks for your vote."
......@@ -476,6 +481,10 @@ msgstr "Reiniciar la contrasenya a %(site_name)s"
msgid "You are now registered. Activation email sent."
msgstr "Ja esteu registrat. S'ha enviat el correu d'activació."
#, fuzzy
#~ msgid "%s has voted."
#~ msgstr "%s ha votat"
#, fuzzy
#~ msgid "easy poll sharing"
#~ msgstr "Compartició fàcil d'enquestes"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-20 17:42+0200\n"
"POT-Creation-Date: 2013-05-21 11:43+0200\n"
"PO-Revision-Date: 2010-10-24 22:27+0100\n"
"Last-Translator: Christophe Siraut <chris@tobald.eu.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -78,14 +78,19 @@ msgstr "votre nom:"
msgid "You have voted."
msgstr "Vous avez voté."
#: meetingpoll/views.py:253
#: meetingpoll/views.py:256
msgid "Login let you modify your vote anytime."
msgstr "S'authentifier permet de modifier le vote ulterieurement."
#: meetingpoll/views.py:261
#: meetingpoll/views.py:262
#, python-format
msgid "%s has voted"
msgstr "%s a voté."
msgid "%s has voted and can still modify its vote."
msgstr "%s a voté et peut encore modifier son vote."
#: meetingpoll/views.py:263 meetingpoll/views.py:277
#, python-format
msgid "Not %s? Click Forget me."
msgstr "Vous n'êtes pas %s? Cliquez Oublie-moi."
#: poll/views.py:28
msgid "Thanks for your vote."
......@@ -472,3 +477,6 @@ msgstr ""
#: templates/registration/registration_complete.html:5
msgid "You are now registered. Activation email sent."
msgstr "Vous êtes maintenant enregistré. Un email d'activation a été envoyé."
#~ msgid "%s has voted."
#~ msgstr "%s a voté."
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-20 17:42+0200\n"
"POT-Creation-Date: 2013-05-21 11:43+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -84,13 +84,18 @@ msgstr "Uw naam:"
msgid "You have voted."
msgstr ""
#: meetingpoll/views.py:253
#: meetingpoll/views.py:256
msgid "Login let you modify your vote anytime."
msgstr ""
#: meetingpoll/views.py:261
#: meetingpoll/views.py:262
#, python-format
msgid "%s has voted"
msgid "%s has voted and can still modify its vote."
msgstr ""
#: meetingpoll/views.py:263 meetingpoll/views.py:277
#, python-format
msgid "Not %s? Click Forget me."
msgstr ""
#: poll/views.py:28
......
......@@ -208,9 +208,9 @@ def vote(request, poll_id):
old.save()
is_updated = True
if has_voted:
messages.info(request, _("Your vote has been counted, thank you."))
messages.success(request, _("Your vote has been counted, thank you."))
if is_updated:
messages.info(request, _("Your vote has been updated, thank you."))
messages.success(request, _("Your vote has been updated, thank you."))
if has_voted and poll.user:
try:
if poll.user.userprofile.email_notifications:
......@@ -249,16 +249,18 @@ def vote(request, poll_id):
except:
pass
else:
voter = ''
messages.info(request, _("Login let you modify your vote anytime."))
voter = request.session.get('name')
if voter:
has_voted = True # Used to show "Forget me"
else:
messages.info(request, _("Login let you modify your vote anytime."))
key = 'has_voted-' + poll.id
if request.session.get(key, False):
has_voted = True # Used to show "Forget me"
voter = request.session.get('name')
#error_message = 'Modify your vote? (clear cookie if you are not ' + voter + ')'
try:
bulletin = Bulletin.objects.get(poll=poll, voter=voter)
messages.info(request, _('%s has voted') % voter)
messages.success(request, _('%s has voted and can still modify its vote.') % voter)
messages.info(request, _('Not %s? Click Forget me.') % voter)
diff = len(vforms) - len(Vote.objects.filter(bulletin=bulletin))
if diff == 0:
"""
......@@ -270,6 +272,9 @@ def vote(request, poll_id):
except:
pass
else:
if voter:
messages.info(request, _('Not %s? Click Forget me.') % voter)
form = BulletinForm(instance=poll,initial={'voter': voter})
#form = BulletinForm(instance=poll)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment