[odrs-web/oscp] Only show reviews with more than one report
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [odrs-web/oscp] Only show reviews with more than one report
- Date: Mon, 1 Jul 2019 13:27:46 +0000 (UTC)
commit f62720f187091bc602632018099cb9f9294d67bc
Author: Richard Hughes <richard hughsie com>
Date: Fri Jun 28 16:12:42 2019 +0100
Only show reviews with more than one report
It's too easy for users to click the button causing extra work for the moderators.
app_data/odrs/templates/default.html | 2 +-
app_data/odrs/views_admin.py | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/app_data/odrs/templates/default.html b/app_data/odrs/templates/default.html
index a8b5f24..bb61a36 100644
--- a/app_data/odrs/templates/default.html
+++ b/app_data/odrs/templates/default.html
@@ -34,7 +34,7 @@
<li><a href="{{url_for('.admin_show_all')}}">All Reviews</a></li>
{% if g.user is defined %}
<li><a href="{{url_for('.odrs_show_unmoderated')}}">Queue</a></li>
- <li><a href="{{url_for('.odrs_show_reported')}}">Reported</a></li>
+ <li><a href="{{url_for('.odrs_show_reported', limit=2)}}">Reported</a></li>
{% if g.user.is_admin %}
<li><a href="{{url_for('.admin_show_stats')}}">Statistics</a></li>
<li><a href="{{url_for('.admin_users_all')}}">Users</a></li>
diff --git a/app_data/odrs/views_admin.py b/app_data/odrs/views_admin.py
index 60edbc1..d263e6e 100644
--- a/app_data/odrs/views_admin.py
+++ b/app_data/odrs/views_admin.py
@@ -445,13 +445,14 @@ def odrs_show_unmoderated():
reviews=reviews)
@app.route('/admin/show/reported')
+@app.route('/admin/show/reported/<int:limit>')
@login_required
-def odrs_show_reported():
+def odrs_show_reported(limit=1):
"""
Return all the reported reviews on the server as HTML.
"""
reviews = db.session.query(Review).\
- filter(Review.reported > 0).\
+ filter(Review.reported >= limit).\
order_by(Review.date_created.desc()).all()
return render_template('show-all.html', reviews=reviews)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]