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
7ce7a156
Commit
7ce7a156
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
added queue forcing
parent
37a00e4a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
helios/stats_urls.py
+1
-0
1 addition, 0 deletions
helios/stats_urls.py
helios/stats_views.py
+9
-0
9 additions, 0 deletions
helios/stats_views.py
helios/templates/stats.html
+1
-1
1 addition, 1 deletion
helios/templates/stats.html
with
11 additions
and
1 deletion
helios/stats_urls.py
+
1
−
0
View file @
7ce7a156
...
...
@@ -11,6 +11,7 @@ from helios.stats_views import *
urlpatterns
=
patterns
(
''
,
(
r
'
^$
'
,
home
),
(
r
'
^force-queue$
'
,
force_queue
),
(
r
'
^elections$
'
,
elections
),
(
r
'
^recent-votes$
'
,
recent_votes
),
)
This diff is collapsed.
Click to expand it.
helios/stats_views.py
+
9
−
0
View file @
7ce7a156
...
...
@@ -13,6 +13,7 @@ from security import *
from
auth.security
import
get_user
,
save_in_session_across_logouts
from
view_utils
import
*
from
helios
import
tasks
def
require_admin
(
request
):
user
=
get_user
(
request
)
...
...
@@ -26,6 +27,14 @@ def home(request):
num_votes_in_queue
=
CastVote
.
objects
.
filter
(
invalidated_at
=
None
,
verified_at
=
None
).
count
()
return
render_template
(
request
,
'
stats
'
,
{
'
num_votes_in_queue
'
:
num_votes_in_queue
})
def
force_queue
(
request
):
user
=
require_admin
(
request
)
votes_in_queue
=
CastVote
.
objects
.
filter
(
invalidated_at
=
None
,
verified_at
=
None
)
for
cv
in
votes_in_queue
:
tasks
.
cast_vote_verify_and_store
.
delay
(
cv
.
id
)
return
HttpResponseRedirect
(
reverse
(
home
))
def
elections
(
request
):
user
=
require_admin
(
request
)
...
...
This diff is collapsed.
Click to expand it.
helios/templates/stats.html
+
1
−
1
View file @
7ce7a156
...
...
@@ -9,6 +9,6 @@
<li>
<a
href=
"{% url helios.stats_views.recent_votes %}"
>
recent votes
</a></li>
</ul>
<p><b>
{{num_votes_in_queue}}
</b>
votes in queue.
</p>
<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>
{% endblock %}
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