From b85627da5c285e07ecd7893216aef9ed7a0aca70 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 19 Dec 2021 11:29:54 +0100 Subject: [PATCH] Fix for adding/deleting visibility restrictions on custom columns/tags --- cps/admin.py | 15 +++++++++++++-- optional-requirements.txt | 2 +- setup.cfg | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index 04d9138f..1c228e49 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -756,7 +756,12 @@ def prepare_tags(user, action, tags_name, id_list): return ",".join(saved_tags_list) -@admi.route("/ajax/addrestriction/", defaults={"user_id": 0}, methods=['POST']) +@admi.route("/ajax/addrestriction/", methods=['POST']) +@login_required +@admin_required +def add_user_0_restriction(res_type): + return add_restriction(res_type, 0) + @admi.route("/ajax/addrestriction//", methods=['POST']) @login_required @admin_required @@ -803,7 +808,13 @@ def add_restriction(res_type, user_id): return "" -@admi.route("/ajax/deleterestriction/", defaults={"user_id": 0}, methods=['POST']) +@admi.route("/ajax/deleterestriction/", methods=['POST']) +@login_required +@admin_required +def delete_user_0_restriction(res_type): + return delete_restriction(res_type, 0) + + @admi.route("/ajax/deleterestriction//", methods=['POST']) @login_required @admin_required diff --git a/optional-requirements.txt b/optional-requirements.txt index 03f58bb5..3fac14ca 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -12,7 +12,7 @@ rsa>=3.4.2,<4.8.0 six>=1.10.0,<1.17.0 # Gdrive and Gmail integration -google-api-python-client>=1.7.11,<2.32.0 +google-api-python-client>=1.7.11,<2.34.0 # Gmail google-auth-oauthlib>=0.4.3,<0.5.0 diff --git a/setup.cfg b/setup.cfg index fc74a1ed..87f6055f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -56,7 +56,7 @@ install_requires = [options.extras_require] gdrive = - google-api-python-client>=1.7.11,<2.32.0 + google-api-python-client>=1.7.11,<2.34.0 gevent>20.6.0,<22.0.0 greenlet>=0.4.17,<1.2.0 httplib2>=0.9.2,<0.21.0 @@ -70,7 +70,7 @@ gdrive = six>=1.10.0,<1.17.0 gmail = google-auth-oauthlib>=0.4.3,<0.5.0 - google-api-python-client>=1.7.11,<2.32.0 + google-api-python-client>=1.7.11,<2.34.0 goodreads = goodreads>=0.3.2,<0.4.0 python-Levenshtein>=0.12.0,<0.13.0