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
a6d50005
Commit
a6d50005
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
added report for viewing elections that have been unfrozen for too long
parent
748be96a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
helios/stats_urls.py
+1
-0
1 addition, 0 deletions
helios/stats_urls.py
helios/stats_views.py
+8
-0
8 additions, 0 deletions
helios/stats_views.py
helios/templates/stats.html
+1
-0
1 addition, 0 deletions
helios/templates/stats.html
helios/views.py
+1
-1
1 addition, 1 deletion
helios/views.py
with
11 additions
and
1 deletion
helios/stats_urls.py
+
1
−
0
View file @
a6d50005
...
...
@@ -13,5 +13,6 @@ urlpatterns = patterns(
(
r
'
^$
'
,
home
),
(
r
'
^force-queue$
'
,
force_queue
),
(
r
'
^elections$
'
,
elections
),
(
r
'
^problem-elections$
'
,
recent_problem_elections
),
(
r
'
^recent-votes$
'
,
recent_votes
),
)
This diff is collapsed.
Click to expand it.
helios/stats_views.py
+
8
−
0
View file @
a6d50005
...
...
@@ -56,3 +56,11 @@ def recent_votes(request):
elections_with_votes_in_24hours
=
Election
.
objects
.
filter
(
voter__castvote__cast_at__gt
=
datetime
.
datetime
.
utcnow
()
-
datetime
.
timedelta
(
days
=
1
)).
annotate
(
last_cast_vote
=
Max
(
'
voter__castvote__cast_at
'
),
num_recent_cast_votes
=
Count
(
'
voter__castvote
'
)).
order_by
(
'
-last_cast_vote
'
)
return
render_template
(
request
,
"
stats_recent_votes
"
,
{
'
elections
'
:
elections_with_votes_in_24hours
})
def
recent_problem_elections
(
request
):
user
=
require_admin
(
request
)
# elections left unfrozen older than 1 day old (and younger than 10 days old, so we don't go back too far)
elections_with_problems
=
Election
.
objects
.
filter
(
frozen_at
=
None
,
created_at__gt
=
datetime
.
datetime
.
utcnow
()
-
datetime
.
timedelta
(
days
=
10
),
created_at__lt
=
datetime
.
datetime
.
utcnow
()
-
datetime
.
timedelta
(
days
=
1
)
)
return
render_template
(
request
,
"
stats_problem_elections
"
,
{
'
elections
'
:
elections_with_problems
})
This diff is collapsed.
Click to expand it.
helios/templates/stats.html
+
1
−
0
View file @
a6d50005
...
...
@@ -7,6 +7,7 @@
<ul>
<li>
<a
href=
"{% url helios.stats_views.elections %}"
>
elections
</a></li>
<li>
<a
href=
"{% url helios.stats_views.recent_votes %}"
>
recent votes
</a></li>
<li>
<a
href=
"{% url helios.stats_views.recent_problem_elections %}"
>
recent problem elections
</a></li>
</ul>
<p><b>
{{num_votes_in_queue}}
</b>
votes in queue. {% if num_votes_in_queue %}[
<a
href=
"{% url helios.stats_views.force_queue %}"
>
force it
</a>
]{% endif %}
</p>
...
...
This diff is collapsed.
Click to expand it.
helios/views.py
+
1
−
1
View file @
a6d50005
...
...
@@ -105,7 +105,7 @@ def admin_autologin(request):
users
=
User
.
objects
.
filter
(
admin_p
=
True
)
if
len
(
users
)
==
0
:
users
=
User
.
objects
.
all
(
)
return
HttpResponse
(
"
no admin users!
"
)
if
len
(
users
)
==
0
:
return
HttpResponse
(
"
no users!
"
)
...
...
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