mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-18 06:39:55 +00:00
replace several store_true keys to booleanoptionalaction alternative (#74)
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
#
|
||||
from aiohttp.web import HTTPBadRequest, HTTPNoContent, HTTPNotFound, Response, json_response
|
||||
|
||||
from ahriman.core.exceptions import UnknownPackage
|
||||
from ahriman.core.exceptions import UnknownPackageError
|
||||
from ahriman.models.build_status import BuildStatusEnum
|
||||
from ahriman.models.package import Package
|
||||
from ahriman.models.user_access import UserAccess
|
||||
@ -54,7 +54,7 @@ class PackageView(BaseView):
|
||||
|
||||
try:
|
||||
package, status = self.service.get(base)
|
||||
except UnknownPackage:
|
||||
except UnknownPackageError:
|
||||
raise HTTPNotFound()
|
||||
|
||||
response = [
|
||||
@ -104,7 +104,7 @@ class PackageView(BaseView):
|
||||
|
||||
try:
|
||||
self.service.update(base, status, package)
|
||||
except UnknownPackage:
|
||||
except UnknownPackageError:
|
||||
raise HTTPBadRequest(reason=f"Package {base} is unknown, but no package body set")
|
||||
|
||||
raise HTTPNoContent()
|
||||
|
@ -26,7 +26,7 @@ from aiohttp import web
|
||||
from ahriman.core.auth import Auth
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.database import SQLite
|
||||
from ahriman.core.exceptions import InitializeException
|
||||
from ahriman.core.exceptions import InitializeError
|
||||
from ahriman.core.spawn import Spawn
|
||||
from ahriman.core.status.watcher import Watcher
|
||||
from ahriman.web.middlewares.exception_handler import exception_handler
|
||||
@ -62,7 +62,7 @@ async def on_startup(application: web.Application) -> None:
|
||||
except Exception:
|
||||
message = "could not load packages"
|
||||
application.logger.exception(message)
|
||||
raise InitializeException(message)
|
||||
raise InitializeError(message)
|
||||
|
||||
|
||||
def run_server(application: web.Application) -> None:
|
||||
|
Reference in New Issue
Block a user