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
f3cb8782
Commit
f3cb8782
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
made sure one can cast a vote as a password voter even if one is not logged in as FB/Twitter/etc
parent
388c8692
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/tests.py
+11
-0
11 additions, 0 deletions
helios/tests.py
helios/views.py
+1
-1
1 addition, 1 deletion
helios/views.py
with
12 additions
and
1 deletion
helios/tests.py
+
11
−
0
View file @
f3cb8782
...
...
@@ -451,6 +451,12 @@ class ElectionBlackboxTests(TestCase):
username
=
re
.
search
(
'
voter ID: (.*)
'
,
email_message
.
body
).
group
(
1
)
password
=
re
.
search
(
'
password: (.*)
'
,
email_message
.
body
).
group
(
1
)
# now log out as administrator
session
=
self
.
client
.
session
del
session
[
'
user
'
]
session
.
save
()
self
.
assertEquals
(
self
.
client
.
session
.
has_key
(
'
user
'
),
False
)
# vote by preparing a ballot via the server-side encryption
response
=
self
.
client
.
post
(
"
/helios/elections/%s/encrypt-ballot
"
%
election_id
,
{
'
answers_json
'
:
utils
.
to_json
([[
1
]])})
...
...
@@ -492,6 +498,11 @@ class ElectionBlackboxTests(TestCase):
response
=
self
.
client
.
get
(
"
/helios/elections/%s/cast_done
"
%
election_id
)
assert
not
self
.
client
.
session
.
has_key
(
'
CURRENT_VOTER
'
)
# log back in as administrator
session
=
self
.
client
.
session
session
[
'
user
'
]
=
{
'
type
'
:
self
.
user
.
user_type
,
'
user_id
'
:
self
.
user
.
user_id
}
session
.
save
()
# 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
+
1
−
1
View file @
f3cb8782
...
...
@@ -613,7 +613,7 @@ def one_election_cast_confirm(request, election):
# if user is not logged in
# bring back to the confirmation page to let him know
if
not
user
or
not
voter
:
if
not
voter
:
return
HttpResponseRedirect
(
reverse
(
one_election_cast_confirm
,
args
=
[
election
.
uuid
]))
# don't store the vote in the voter's data structure until verification
...
...
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