Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nuages
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etch
nuages
Commits
1da8f18c
Commit
1da8f18c
authored
Aug 26, 2014
by
Christophe Siraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enable minute selection
parent
944b9ebe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
meetingpoll/forms.py
meetingpoll/forms.py
+1
-5
meetingpoll/views.py
meetingpoll/views.py
+7
-6
No files found.
meetingpoll/forms.py
View file @
1da8f18c
...
...
@@ -6,7 +6,7 @@ from datetimewidget.widgets import DateTimeWidget
dateTimeOptions
=
{
'weekStart'
:
'1'
,
'minView'
:
'
1
'
,
'minView'
:
'
0
'
,
'minuteStep'
:
'15'
,
'startDate'
:
datetime
.
today
().
date
(),
'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
...
...
meetingpoll/views.py
View file @
1da8f18c
...
...
@@ -77,11 +77,11 @@ def editchoices(request, poll_id):
for
choice
in
Choice
.
objects
.
filter
(
poll
=
poll
.
id
)]
for
v
in
votes
:
v
.
save
()
poll
.
save
()
if
request
.
user
.
is_anonymous
():
# Anonymous has voted...
key
=
'has_voted-'
+
poll
.
id
request
.
session
[
key
]
=
True
# This writes cookie
request
.
session
[
'name'
]
=
voter
# This writes cookie
poll
.
save
()
return
HttpResponseRedirect
(
reverse
(
'meetingpoll'
,
args
=
(
str
(
poll
.
id
),)))
else
:
...
...
@@ -217,18 +217,19 @@ def vote(request, poll_id):
old
.
comment
=
vorm
.
cleaned_data
[
'comment'
]
old
.
save
()
is_updated
=
True
poll
.
save
()
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
:
try
:
if
poll
.
user
.
userprofile
.
email_notifications
:
email_notify
(
poll
,
voter
)
except
:
pass
if
has_voted
or
is_updated
:
messages
.
success
(
request
,
_
(
"Your vote has been counted, thank you."
))
poll
.
save
()
return
HttpResponseRedirect
(
reverse
(
'vote'
,
args
=
(
poll_id
,)))
else
:
messages
.
error
(
request
,
_
(
'Did you forget to provide your name?'
))
voter
=
_
(
'your name'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment