Commit 14d6bf2e authored by shadMod's avatar shadMod 💬

mv download.py in src/download and rename with views.py

parent 97fdc4aa
# Source code of the Ubuntu-it website # Source code of the Ubuntu-it website
# Copyright (C) 2016 Pietro Albini <pietroalbini@ubuntu.com> # Copyright (C) 2016 Pietro Albini <pietroalbini@ubuntu.com>
# Copyright (C) 2023 shadMod # Copyright (C) 2023 shadMod <m.allegro@shadmod.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published # it under the terms of the GNU Affero General Public License as published
...@@ -26,9 +26,8 @@ import flask ...@@ -26,9 +26,8 @@ import flask
import requests import requests
import itsdangerous import itsdangerous
from . import cache from ... import cache
from . import launchpad from ... import launchpad
from .constants import UITWWW_DIR
DOWNLOAD_FILE = "downloads.toml" DOWNLOAD_FILE = "downloads.toml"
CACHE_FILE = "download-cache.json" CACHE_FILE = "download-cache.json"
...@@ -245,6 +244,9 @@ class Downloads: ...@@ -245,6 +244,9 @@ class Downloads:
arch = flask.request.form["arch"] arch = flask.request.form["arch"]
except KeyError: except KeyError:
flask.abort(400) flask.abort(400)
raise KeyError
except Exception:
raise Exception
# Validate the input # Validate the input
if distro not in self.config["distros"]: if distro not in self.config["distros"]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment