From d532547c74c4ca156d712299f580bc72e50f645a Mon Sep 17 00:00:00 2001 From: Dennis Priskorn Date: Thu, 25 Jan 2024 12:10:45 +0100 Subject: [PATCH] feat: Warn user on toolforge about bug --- app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.py b/app.py index f390503..36234c3 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,5 @@ import logging +import os from typing import List, Optional from urllib.parse import quote, unquote @@ -154,6 +155,11 @@ def add_main_subject(): selected_qids = request.form.getlist("selected_qids[]") topic = request.form.get("main_subject") if selected_qids and topic: + if len(selected_qids) > 30 and "topic-curator" in os.environ.get('USER'): + return jsonify("Error: Toolforge does not support long URLs " + "so we cannot process this many QIDs at once. " + "An OAUTH rewrite is planned, see " + "https://github.com/dpriskorn/WikidataTopicCurator/issues/5") # Handle the selected_qids as needed print(f"Got topic: {topic}") print("Selected QIDs:", selected_qids)