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
c4787318
Commit
c4787318
authored
3 years ago
by
Ben Adida
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
allow viewing a vote by full hash so we don't do quite as many DB queries.
parent
1da79be3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
helios/templates/voters_list.html
+1
-1
1 addition, 1 deletion
helios/templates/voters_list.html
helios/url_names.py
+2
-1
2 additions, 1 deletion
helios/url_names.py
helios/urls.py
+3
-0
3 additions, 0 deletions
helios/urls.py
helios/views.py
+8
-0
8 additions, 0 deletions
helios/views.py
with
14 additions
and
2 deletions
helios/templates/voters_list.html
+
1
−
1
View file @
c4787318
...
...
@@ -143,7 +143,7 @@ Voters {{voters_page.start_index}} - {{voters_page.end_index}} (of {{total_voter
{% if election.use_voter_aliases %}
<td>
{{voter.alias}}
</td>
{% endif %}
<td><tt
style=
"font-size: 1.4em;"
>
{% if voter.vote_hash %}{{voter.vote_hash}}
<span
style=
"font-size:0.8em;"
>
[
<a
href=
"{% url "
shortcut
@
vote
"
vote_
tiny
hash=
voter.vote_
tiny
hash
%}"
>
view
</a>
]
</span>
{% else %}
—
{% endif %}
</tt></td>
<td><tt
style=
"font-size: 1.4em;"
>
{% if voter.vote_hash %}{{voter.vote_hash}}
<span
style=
"font-size:0.8em;"
>
[
<a
href=
"{% url "
shortcut
-fullhash
@
vote
"
vote_hash=
voter.vote_hash
%}"
>
view
</a>
]
</span>
{% else %}
—
{% endif %}
</tt></td>
</tr>
{% endfor %}
</table>
...
...
This diff is collapsed.
Click to expand it.
helios/url_names.py
+
2
−
1
View file @
c4787318
...
...
@@ -3,7 +3,7 @@ from helios import election_url_names as election, stats_url_names as stats
__all__
=
[
"
election
"
,
"
stats
"
,
"
COOKIE_TEST
"
,
"
COOKIE_TEST_2
"
,
"
COOKIE_NO
"
,
"
ELECTION_SHORTCUT
"
,
"
ELECTION_SHORTCUT_VOTE
"
,
"
CAST_VOTE_SHORTCUT
"
,
"
ELECTION_SHORTCUT
"
,
"
ELECTION_SHORTCUT_VOTE
"
,
"
CAST_VOTE_SHORTCUT
"
,
"
CAST_VOTE_FULLHASH_SHORTCUT
"
,
"
TRUSTEE_LOGIN
"
,
"
ELECTIONS_PARAMS
"
,
"
ELECTIONS_VERIFIER
"
,
"
ELECTIONS_VERIFIER_SINGLE_BALLOT
"
,
"
ELECTIONS_NEW
"
,
"
ELECTIONS_ADMINISTERED
"
,
"
ELECTIONS_VOTED
"
,
...
...
@@ -16,6 +16,7 @@ COOKIE_NO="cookie@no"
ELECTION_SHORTCUT
=
"
shortcut@election
"
ELECTION_SHORTCUT_VOTE
=
"
shortcut@election@vote
"
CAST_VOTE_SHORTCUT
=
"
shortcut@vote
"
CAST_VOTE_FULLHASH_SHORTCUT
=
"
shortcut-fullhash@vote
"
TRUSTEE_LOGIN
=
"
trustee@login
"
...
...
This diff is collapsed.
Click to expand it.
helios/urls.py
+
3
−
0
View file @
c4787318
...
...
@@ -16,6 +16,9 @@ urlpatterns = [
# vote shortcut
url
(
r
'
^v/(?P<vote_tinyhash>[^/]+)$
'
,
views
.
castvote_shortcut
,
name
=
names
.
CAST_VOTE_SHORTCUT
),
# vote by hash
url
(
r
'
^vh/(?P<vote_hash>[^/]+)$
'
,
views
.
castvote_fullhash_shortcut
,
name
=
names
.
CAST_VOTE_FULLHASH_SHORTCUT
),
# trustee login
url
(
r
'
^t/(?P<election_short_name>[^/]+)/(?P<trustee_email>[^/]+)/(?P<trustee_secret>[^/]+)$
'
,
views
.
trustee_login
,
...
...
This diff is collapsed.
Click to expand it.
helios/views.py
+
8
−
0
View file @
c4787318
...
...
@@ -147,6 +147,14 @@ def castvote_shortcut(request, vote_tinyhash):
return
_castvote_shortcut_by_election
(
request
,
election_uuid
=
cast_vote
.
voter
.
election
.
uuid
,
cast_vote
=
cast_vote
)
def
castvote_fullhash_shortcut
(
request
,
vote_hash
):
try
:
cast_vote
=
CastVote
.
objects
.
get
(
vote_hash
=
vote_hash
)
except
CastVote
.
DoesNotExist
:
raise
Http404
return
_castvote_shortcut_by_election
(
request
,
election_uuid
=
cast_vote
.
voter
.
election
.
uuid
,
cast_vote
=
cast_vote
)
@trustee_check
def
trustee_keygenerator
(
request
,
election
,
trustee
):
"""
...
...
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