Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Release Engineering
Public
distrobuild
Commits
e6fde354
Unverified
Commit
e6fde354
authored
Apr 11, 2021
by
Neil Hanlon
Browse files
fix: A couple other routes need protecting
parent
7e380edf
Changes
2
Hide whitespace changes
Inline
Side-by-side
distrobuild/routes/builds.py
View file @
e6fde354
...
...
@@ -63,6 +63,8 @@ async def get_build(build_id: int):
@
router
.
post
(
"/{build_id}/cancel"
,
status_code
=
202
)
async
def
cancel_build
(
build_id
:
int
):
get_user
(
request
)
build_obj
=
await
Build
.
filter
(
id
=
build_id
,
cancelled
=
False
).
get_or_none
()
if
not
build_obj
:
raise
HTTPException
(
404
,
detail
=
"build does not exist or is already cancelled"
)
...
...
distrobuild/routes/imports.py
View file @
e6fde354
...
...
@@ -72,6 +72,8 @@ async def get_import_logs(import_id: int):
@
router
.
post
(
"/{import_id}/cancel"
,
status_code
=
202
)
async
def
cancel_import
(
import_id
:
int
):
user
=
get_user
(
request
)
import_obj
=
await
Import
.
filter
(
id
=
import_id
,
cancelled
=
False
).
get_or_none
()
if
not
import_obj
:
raise
HTTPException
(
404
,
detail
=
"import does not exist or is already cancelled"
)
...
...
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