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
383f0102
Commit
383f0102
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
efficiency fixes, UTC indication
parent
8a301316
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
auth/security/__init__.py
+1
-1
1 addition, 1 deletion
auth/security/__init__.py
helios/models.py
+2
-2
2 additions, 2 deletions
helios/models.py
helios/templates/election_view.html
+3
-3
3 additions, 3 deletions
helios/templates/election_view.html
helios/views.py
+2
-2
2 additions, 2 deletions
helios/views.py
with
8 additions
and
8 deletions
auth/security/__init__.py
+
1
−
1
View file @
383f0102
...
...
@@ -92,7 +92,7 @@ def admin_required(func):
# get the user
def
get_user
(
request
):
# push the expiration of the session back
request
.
session
.
set_expiry
(
settings
.
SESSION_COOKIE_AGE
)
#
request.session.set_expiry(settings.SESSION_COOKIE_AGE)
# set up CSRF protection if needed
if
not
request
.
session
.
has_key
(
'
csrf_token
'
)
or
type
(
request
.
session
[
'
csrf_token
'
])
!=
str
:
...
...
This diff is collapsed.
Click to expand it.
helios/models.py
+
2
−
2
View file @
383f0102
...
...
@@ -152,7 +152,7 @@ class Election(models.Model, electionalgs.Election):
@classmethod
def
get_by_uuid
(
cls
,
uuid
):
try
:
return
cls
.
objects
.
get
(
uuid
=
uuid
)
return
cls
.
objects
.
select_related
().
get
(
uuid
=
uuid
)
except
cls
.
DoesNotExist
:
return
None
...
...
@@ -599,7 +599,7 @@ class Voter(models.Model, electionalgs.Voter):
@classmethod
def
get_by_user
(
cls
,
user
):
return
cls
.
objects
.
filter
(
voter_type
=
user
.
user_type
,
voter_id
=
user
.
user_id
).
order_by
(
'
-cast_at
'
)
return
cls
.
objects
.
select_related
().
filter
(
voter_type
=
user
.
user_type
,
voter_id
=
user
.
user_id
).
order_by
(
'
-cast_at
'
)
@property
def
user
(
self
):
...
...
This diff is collapsed.
Click to expand it.
helios/templates/election_view.html
+
3
−
3
View file @
383f0102
...
...
@@ -165,12 +165,12 @@ For your privacy, you'll be asked to log in only once your ballot is encrypted.
{% endif %}
{% if election.voting_extended_until %}
<br
/>
This election was initially scheduled to end at {{election.voting_ends_at}},
<br
/>
but has been extended until {{ election.voting_extended_until }}.
This election was initially scheduled to end at {{election.voting_ends_at}}
(UTC)
,
<br
/>
but has been extended until {{ election.voting_extended_until }}
(UTC)
.
{% else %}
{% if election.voting_ends_at %}
<br
/>
This election is scheduled to end at {{election.voting_ends_at}}.
This election is scheduled to end at {{election.voting_ends_at}}
(UTC)
.
{% else %}
<br
/>
This election ends at the administrator's discretion.
...
...
This diff is collapsed.
Click to expand it.
helios/views.py
+
2
−
2
View file @
383f0102
...
...
@@ -898,11 +898,11 @@ def voters_list_pretty(request, election):
else
:
voters
=
voters
.
filter
(
name__icontains
=
q
)
total_voters
=
voters
.
count
()
voter_paginator
=
Paginator
(
voters
,
limit
)
voters_page
=
voter_paginator
.
page
(
page
)
total_voters
=
voter_paginator
.
count
return
render_template
(
request
,
'
voters_list
'
,
{
'
election
'
:
election
,
'
voters_page
'
:
voters_page
,
'
voters
'
:
voters_page
.
object_list
,
'
admin_p
'
:
admin_p
,
'
email_voters
'
:
helios
.
VOTERS_EMAIL
,
...
...
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