Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito
Commits
14d6bf2e
Commit
14d6bf2e
authored
Dec 02, 2023
by
shadMod
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mv download.py in src/download and rename with views.py
parent
97fdc4aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
uitwww/src/download/views.py
uitwww/src/download/views.py
+9
-7
No files found.
uitwww/
download
.py
→
uitwww/
src/download/views
.py
View file @
14d6bf2e
# 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
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# GNU Affero General Public License for more details.
# GNU Affero General Public License for more details.
#
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU Affero General Public License
# along with this program.
If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
hashlib
import
hashlib
import
json
import
json
...
@@ -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,8 +244,11 @@ class Downloads:
...
@@ -245,8 +244,11 @@ 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"
]:
flask
.
abort
(
400
)
flask
.
abort
(
400
)
if
release
not
in
self
.
config
[
"distros"
][
distro
][
"releases"
]:
if
release
not
in
self
.
config
[
"distros"
][
distro
][
"releases"
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment