Commit 1da8f18c authored by Christophe Siraut's avatar Christophe Siraut
Browse files

Re-enable minute selection

parent 944b9ebe
......@@ -6,7 +6,7 @@ from datetimewidget.widgets import DateTimeWidget
dateTimeOptions = {
'weekStart': '1',
'minView': '1',
'minView': '0',
'minuteStep': '15',
'todayHighlight': 'true',
......@@ -19,16 +19,12 @@ class UserProfileForm(forms.ModelForm):
fields = ('email_notifications',)
class DateTimeWidgetFixed(DateTimeWidget):
'''a hack for 1. returning a string and 2. returning a
fixed hour value (xx:00:00)'''
def __init__(self, **kwargs):
super(DateTimeWidgetFixed, self).__init__(**kwargs)
def value_from_datadict(self, data, files, name):
a = str(super(
DateTimeWidgetFixed, self).value_from_datadict(data, files, name))
a = ''.join(a.split(':')[0]) + ':00:00'
return a
......@@ -77,11 +77,11 @@ def editchoices(request, poll_id):
for choice in Choice.objects.filter(]
for v in votes:
if request.user.is_anonymous(): # Anonymous has voted...
key = 'has_voted-' +
request.session[key] = True # This writes cookie
request.session['name'] = voter # This writes cookie
return HttpResponseRedirect(reverse('meetingpoll', args=(str(,)))
......@@ -217,18 +217,19 @@ def vote(request, poll_id):
old.comment = vorm.cleaned_data['comment']
is_updated = True
if has_voted:
messages.success(request, _("Your vote has been counted, thank you."))
if is_updated:
messages.success(request, _("Your vote has been updated, thank you."))
if has_voted and poll.user:
if poll.user.userprofile.email_notifications:
email_notify(poll, voter)
if has_voted or is_updated:
messages.success(request, _("Your vote has been counted, thank you."))
return HttpResponseRedirect(reverse('vote', args=(poll_id,)))
messages.error(request, _('Did you forget to provide your name?'))
voter = _('your name')
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