diff --git a/handlers/difficultyRatingHandler.py b/handlers/difficultyRatingHandler.py new file mode 100644 index 00000000..934129df --- /dev/null +++ b/handlers/difficultyRatingHandler.py @@ -0,0 +1,14 @@ +from tornado.gen import engine +from tornado.web import asynchronous +from common.web import requestsManager + +class handler(requestsManager.asyncRequestHandler): + @asynchronous + @engine + def asyncPost(self): + try: + self.set_status(307, "Moved Temporarily") + self.add_header("Location", f"https://osu.ppy.sh/difficulty-rating") + except ValueError: + self.set_status(400) + self.write("") diff --git a/handlers/submitModularHandler.pyx b/handlers/submitModularHandler.pyx index d491a101..4ddf9000 100644 --- a/handlers/submitModularHandler.pyx +++ b/handlers/submitModularHandler.pyx @@ -31,7 +31,7 @@ from objects import beatmap from objects import glob from objects import score from objects import scoreboard -from objects.charts import BeatmapChart, OverallChart , OverallChartFailed , BeatmapChartFailed +from objects.charts import BeatmapChart, OverallChart, OverallChartFailed, BeatmapChartFailed from secret import butterCake class handler(requestsManager.asyncRequestHandler): diff --git a/lets.py b/lets.py index 99da3cf7..d4414549 100644 --- a/lets.py +++ b/lets.py @@ -45,6 +45,7 @@ from handlers import uploadScreenshotHandler from handlers import commentHandler from handlers import seasonalHandler +from handlers import difficultyRatingHandler from helpers import consoleHelper from common import agpl from objects import glob @@ -92,6 +93,8 @@ def make_app(): (r"/web/osu-addfavourite.php", emptyHandler.handler), (r"/loadTest", loadTestHandler.handler), + + (r"/difficulty-rating", difficultyRatingHandler.handler), ], default_handler_class=defaultHandler.handler)