mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
raise httpexception instead of returning it from a function
This commit is contained in:
parent
182bde5e09
commit
c9a155bbc4
@ -49,4 +49,4 @@ class AddView(BaseView):
|
|||||||
|
|
||||||
self.spawner.packages_add(packages, now)
|
self.spawner.packages_add(packages, now)
|
||||||
|
|
||||||
return HTTPFound("/")
|
raise HTTPFound("/")
|
||||||
|
@ -45,4 +45,4 @@ class ReloadAuthView(BaseView):
|
|||||||
self.request.app.logger.warning("could not update authentication module validator", exc_info=True)
|
self.request.app.logger.warning("could not update authentication module validator", exc_info=True)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
return HTTPNoContent()
|
raise HTTPNoContent()
|
||||||
|
@ -47,4 +47,4 @@ class RemoveView(BaseView):
|
|||||||
|
|
||||||
self.spawner.packages_remove(packages)
|
self.spawner.packages_remove(packages)
|
||||||
|
|
||||||
return HTTPFound("/")
|
raise HTTPFound("/")
|
||||||
|
@ -55,4 +55,4 @@ class AhrimanView(BaseView):
|
|||||||
|
|
||||||
self.service.update_self(status)
|
self.service.update_self(status)
|
||||||
|
|
||||||
return HTTPNoContent()
|
raise HTTPNoContent()
|
||||||
|
@ -58,7 +58,7 @@ class PackageView(BaseView):
|
|||||||
base = self.request.match_info["package"]
|
base = self.request.match_info["package"]
|
||||||
self.service.remove(base)
|
self.service.remove(base)
|
||||||
|
|
||||||
return HTTPNoContent()
|
raise HTTPNoContent()
|
||||||
|
|
||||||
async def post(self) -> Response:
|
async def post(self) -> Response:
|
||||||
"""
|
"""
|
||||||
@ -87,4 +87,4 @@ class PackageView(BaseView):
|
|||||||
except UnknownPackage:
|
except UnknownPackage:
|
||||||
return json_response(data=f"Package {base} is unknown, but no package body set", status=400)
|
return json_response(data=f"Package {base} is unknown, but no package body set", status=400)
|
||||||
|
|
||||||
return HTTPNoContent()
|
raise HTTPNoContent()
|
||||||
|
@ -47,4 +47,4 @@ class PackagesView(BaseView):
|
|||||||
"""
|
"""
|
||||||
self.service.load()
|
self.service.load()
|
||||||
|
|
||||||
return HTTPNoContent()
|
raise HTTPNoContent()
|
||||||
|
@ -46,7 +46,7 @@ class LoginView(BaseView):
|
|||||||
raise HTTPMethodNotAllowed(self.request.method, ["POST"])
|
raise HTTPMethodNotAllowed(self.request.method, ["POST"])
|
||||||
|
|
||||||
if not code:
|
if not code:
|
||||||
return HTTPFound(oauth_provider.get_oauth_url())
|
raise HTTPFound(oauth_provider.get_oauth_url())
|
||||||
|
|
||||||
response = HTTPFound("/")
|
response = HTTPFound("/")
|
||||||
username = await oauth_provider.get_oauth_username(code)
|
username = await oauth_provider.get_oauth_username(code)
|
||||||
|
Loading…
Reference in New Issue
Block a user