[odrs-web] Remove /admin/show/unmoderated as its just not helpful



commit 92fbc071d4bcd1ffe4417c0ff55b028695d971b6
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 16 14:55:49 2022 +0000

    Remove /admin/show/unmoderated as its just not helpful

 app_data/odrs/templates/default.html |  1 -
 app_data/odrs/tests/odrs_test.py     |  4 ----
 app_data/odrs/views_admin.py         | 26 --------------------------
 3 files changed, 31 deletions(-)
---
diff --git a/app_data/odrs/templates/default.html b/app_data/odrs/templates/default.html
index 19e46db..13c14d0 100644
--- a/app_data/odrs/templates/default.html
+++ b/app_data/odrs/templates/default.html
@@ -33,7 +33,6 @@
           <ul class="nav navbar-nav">
             <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', limit=2)}}">Reported</a></li>
 {% if g.user.is_admin %}
             <li><a href="{{url_for('.admin_show_stats')}}">Statistics</a></li>
diff --git a/app_data/odrs/tests/odrs_test.py b/app_data/odrs/tests/odrs_test.py
index 613812f..731a3d0 100644
--- a/app_data/odrs/tests/odrs_test.py
+++ b/app_data/odrs/tests/odrs_test.py
@@ -203,9 +203,6 @@ class OdrsTest(unittest.TestCase):
         rv = self.app.get('/admin/show/all')
         assert b'An essential ' in rv.data, rv.data
 
-        rv = self.app.get('/admin/show/unmoderated')
-        assert b'An essential ' in rv.data, rv.data
-
         rv = self.app.get('/admin/show/lang/en_US')
         assert b'An essential ' in rv.data, rv.data
         rv = self.app.get('/admin/show/lang/fr_FR')
@@ -642,7 +639,6 @@ class OdrsTest(unittest.TestCase):
                 '/admin/stats',
                 '/admin/user_ban/1',
                 '/admin/show/reported',
-                '/admin/show/unmoderated',
                 '/admin/stats',
                 '/admin/moderators/all']
         for uri in uris:
diff --git a/app_data/odrs/views_admin.py b/app_data/odrs/views_admin.py
index dd7b334..eabfd7d 100644
--- a/app_data/odrs/views_admin.py
+++ b/app_data/odrs/views_admin.py
@@ -451,32 +451,6 @@ def admin_search(max_results=19):
     return render_template('show-all.html',
                            reviews=reviews)
 
-@app.route('/admin/show/unmoderated')
-@login_required
-def odrs_show_unmoderated():
-    """
-    Return all the reviews on the server as HTML.
-    """
-    if not current_user.user:
-        flash('No user_hash for current user')
-        return redirect(url_for('.odrs_index'))
-
-    # filter by the languages the moderator understands
-    reviews = []
-    langs = _get_langs_for_user(current_user)
-    for r in db.session.query(Review).all():
-        lang = r.locale.split('_')[0]
-        if langs and lang not in langs:
-            continue
-        if _vote_exists(r.review_id, current_user.user.user_id):
-            continue
-        if len(reviews) > 20:
-            break
-        reviews.append(r)
-    return render_template('show-all.html',
-                           pagination=None,
-                           reviews=reviews)
-
 @app.route('/admin/show/reported')
 @app.route('/admin/show/reported/<int:limit>')
 @login_required


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]