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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
7c6d8978
Commit
7c6d8978
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
made sure that, if voting as local-election voter, not logged out of overall account
parent
9e04f5d8
Branches
Branches containing commit
Tags
v3.1.0
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
helios/tests.py
+4
-0
4 additions, 0 deletions
helios/tests.py
helios/views.py
+9
-2
9 additions, 2 deletions
helios/views.py
with
13 additions
and
2 deletions
helios/tests.py
+
4
−
0
View file @
7c6d8978
...
...
@@ -483,6 +483,10 @@ class ElectionBlackboxTests(TestCase):
self
.
assertContains
(
response
,
ballot
.
hash
)
self
.
assertContains
(
response
,
html_escape
(
encrypted_vote
))
# if we request the redirect to cast_done, the voter should be logged out, but not the user
response
=
self
.
client
.
get
(
"
/helios/elections/%s/cast_done
"
%
election_id
)
assert
not
self
.
client
.
session
.
has_key
(
'
CURRENT_VOTER
'
)
# encrypted tally
response
=
self
.
client
.
post
(
"
/helios/elections/%s/compute_tally
"
%
election_id
,
{
"
csrf_token
"
:
self
.
client
.
session
[
'
csrf_token
'
]
...
...
This diff is collapsed.
Click to expand it.
helios/views.py
+
9
−
2
View file @
7c6d8978
...
...
@@ -649,7 +649,13 @@ def one_election_cast_done(request, election):
votes
=
CastVote
.
get_by_voter
(
voter
)
vote_hash
=
votes
[
0
].
vote_hash
# only log out if the setting says so *and* we're dealing
# with a site-wide voter. Definitely remove current_voter
if
voter
.
user
==
user
:
logout
=
settings
.
LOGOUT_ON_CONFIRMATION
else
:
logout
=
False
del
request
.
session
[
'
CURRENT_VOTER
'
]
save_in_session_across_logouts
(
request
,
'
last_vote_hash
'
,
vote_hash
)
else
:
...
...
@@ -664,7 +670,8 @@ 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
,
'
vote_hash
'
:
vote_hash
,
'
logout
'
:
logout
},
include_user
=
False
)
# include_user is set to False if logout is happening
return
render_template
(
request
,
'
cast_done
'
,
{
'
election
'
:
election
,
'
vote_hash
'
:
vote_hash
,
'
logout
'
:
logout
},
include_user
=
(
not
logout
))
@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