Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
etch
nuages
Commits
057f182c
Commit
057f182c
authored
Oct 07, 2010
by
chris
Browse files
fix a nasty bug related to dates reordering
parent
fe56165b
Changes
1
Hide whitespace changes
Inline
Side-by-side
sondage/views.py
View file @
057f182c
...
...
@@ -153,7 +153,7 @@ def vote(request, poll_id):
if
request
.
method
==
'POST'
:
form
=
BulletinForm
(
request
.
POST
,
initial
=
{
'poll'
:
poll
.
id
,})
vforms
=
[
[
VoteForm
(
request
.
POST
,
prefix
=
choice
)
]
for
choice
in
Choice
.
objects
.
filter
(
poll
=
poll
.
id
)
]
vforms
=
[
[
VoteForm
(
request
.
POST
,
prefix
=
choice
)
]
for
choice
in
Choice
.
objects
.
filter
(
poll
=
poll
.
id
)
.
order_by
(
'choice'
)
]
if
form
.
is_valid
():
if
request
.
user
.
is_authenticated
():
...
...
@@ -233,8 +233,7 @@ def vote(request, poll_id):
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
choice
,
'voice'
:
True
,},
prefix
=
choice
)
]
for
choice
in
Choice
.
objects
.
filter
(
poll
=
poll_id
)
]
else
:
# Default formset for unknown user
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
choice
,},
prefix
=
choice
)
]
for
choice
in
Choice
.
objects
.
filter
(
poll
=
poll_id
)
]
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
choice
,},
prefix
=
choice
)
]
for
choice
in
Choice
.
objects
.
filter
(
poll
=
poll_id
).
order_by
(
'choice'
)
]
if
request
.
user
.
is_authenticated
():
voter
=
str
(
request
.
user
)
try
:
...
...
@@ -247,7 +246,7 @@ def vote(request, poll_id):
we should concatenate the existing votes with empty remaing ones...
Give an empty bulletin for now.
"""
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
vote
.
choice
,
'voice'
:
vote
.
voice
,
'comment'
:
vote
.
comment
,},
prefix
=
vote
.
choice
)
]
for
vote
in
Vote
.
objects
.
filter
(
bulletin
=
bulletin
)
]
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
vote
.
choice
,
'voice'
:
vote
.
voice
,
'comment'
:
vote
.
comment
,},
prefix
=
vote
.
choice
)
]
for
vote
in
Vote
.
objects
.
filter
(
bulletin
=
bulletin
)
.
order_by
(
'choice__choice'
)
]
except
:
pass
...
...
@@ -269,7 +268,7 @@ def vote(request, poll_id):
we should concatenate the existing votes with empty remaing ones...
Give an empty bulletin for now.
"""
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
vote
.
choice
,
'voice'
:
vote
.
voice
,
'comment'
:
vote
.
comment
,},
prefix
=
vote
.
choice
)
]
for
vote
in
Vote
.
objects
.
filter
(
bulletin
=
bulletin
)
]
vforms
=
[
[
VoteForm
(
initial
=
{
'choice'
:
vote
.
choice
,
'voice'
:
vote
.
voice
,
'comment'
:
vote
.
comment
,},
prefix
=
vote
.
choice
)
]
for
vote
in
Vote
.
objects
.
filter
(
bulletin
=
bulletin
)
.
order_by
(
'choice__choice'
)
]
except
:
pass
...
...
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