Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
596f03c0
Commit
596f03c0
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
made sure user can reload cast_done without any trouble
parent
1654ad08
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
helios/templates/cast_done.html
+1
-1
1 addition, 1 deletion
helios/templates/cast_done.html
helios/views.py
+17
-4
17 additions, 4 deletions
helios/views.py
with
18 additions
and
5 deletions
helios/templates/cast_done.html
+
1
−
1
View file @
596f03c0
...
...
@@ -10,7 +10,7 @@
<p>
Your smart ballot tracker is:
<br
/><br
/>
<tt
style=
"font-size:1.8em; font-weight: bold; padding-left: 20px;"
>
{{
last_vote.
vote_hash}}
</tt>
<tt
style=
"font-size:1.8em; font-weight: bold; padding-left: 20px;"
>
{{vote_hash}}
</tt>
</p>
{% if logout %}
...
...
This diff is collapsed.
Click to expand it.
helios/views.py
+
17
−
4
View file @
596f03c0
...
...
@@ -551,12 +551,25 @@ def one_election_cast_confirm(request, election):
@election_view
()
def
one_election_cast_done
(
request
,
election
):
"""
This view needs to be loaded because of the IFRAME, but then this causes
problems if someone clicks
"
reload
"
. So we need a strategy.
We store the ballot hash in the session
"""
user
=
get_user
(
request
)
if
user
:
voter
=
Voter
.
get_by_election_and_user
(
election
,
user
)
votes
=
CastVote
.
get_by_voter
(
voter
)
vote_hash
=
votes
[
0
].
vote_hash
logout
=
settings
.
LOGOUT_ON_CONFIRMATION
save_in_session_across_logouts
(
request
,
'
last_vote_hash
'
,
vote_hash
)
else
:
vote_hash
=
request
.
session
[
'
last_vote_hash
'
]
logout
=
False
# local logout ensures that there's no more
# user locally
# WHY DO WE COMMENT THIS OUT? because we want to force a full logout via the iframe, including
...
...
@@ -565,7 +578,7 @@ def one_election_cast_done(request, election):
# auth_views.do_local_logout(request)
# remote logout is happening asynchronously in an iframe to be modular given the logout mechanism
return
render_template
(
request
,
'
cast_done
'
,
{
'
election
'
:
election
,
'
last_vote
'
:
vote
s
[
0
]
,
'
logout
'
:
logout
},
include_user
=
False
)
return
render_template
(
request
,
'
cast_done
'
,
{
'
election
'
:
election
,
'
vote_hash
'
:
vote
_hash
,
'
logout
'
:
logout
},
include_user
=
False
)
@election_view
()
@json
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment