diff --git a/api/obs/api/db.py b/api/obs/api/db.py index 5b15573..6fd33ea 100644 --- a/api/obs/api/db.py +++ b/api/obs/api/db.py @@ -59,7 +59,7 @@ async def init_models(): def random_string(length): letters = string.ascii_lowercase + string.digits - return "".join(random.choice(letters) for i in range(length)) + return "".join(random.choice(letters) for _ in range(length)) @asynccontextmanager diff --git a/api/obs/api/process.py b/api/obs/api/process.py index 9245487..d389bfb 100644 --- a/api/obs/api/process.py +++ b/api/obs/api/process.py @@ -54,7 +54,7 @@ async def process_tracks_loop(delay): data_source = DataSource(tile_source) await process_track(session, track, data_source) - except: + except BaseException: log.exception("Failed to process track. Will continue.") await asyncio.sleep(1) continue diff --git a/api/obs/api/routes/info.py b/api/obs/api/routes/info.py index 8509f9d..1d50f65 100644 --- a/api/obs/api/routes/info.py +++ b/api/obs/api/routes/info.py @@ -1,7 +1,5 @@ import logging -# from sqlalchemy import select - from obs.api.app import api from sanic.response import json diff --git a/api/obs/api/routes/login.py b/api/obs/api/routes/login.py index dbc5463..fdd0c37 100644 --- a/api/obs/api/routes/login.py +++ b/api/obs/api/routes/login.py @@ -22,7 +22,7 @@ client = Client(client_authn_method=CLIENT_AUTHN_METHOD) @auth.before_server_start async def connect_auth_client(app, loop): client.allow["issuer_mismatch"] = True - pc = client.provider_config(app.config.KEYCLOAK_URL) + client.provider_config(app.config.KEYCLOAK_URL) client.store_registration_info( RegistrationResponse( client_id=app.config.KEYCLOAK_CLIENT_ID, @@ -122,6 +122,7 @@ async def login_redirect(req): log.debug("Updating user (id: %s) email from auth system.", user.id) user.email = email + # TODO: re-add username change when we can safely rename users # if preferred_username != user.username: # log.debug("Updating user (id: %s) username from auth system.", user.id) # user.username = preferred_username diff --git a/api/obs/api/routes/tracks.py b/api/obs/api/routes/tracks.py index 504935c..b0c01cb 100644 --- a/api/obs/api/routes/tracks.py +++ b/api/obs/api/routes/tracks.py @@ -211,7 +211,7 @@ async def put_track(req, slug: str): try: body = req.json["track"] - except: + except BaseException: body = {} if "title" in body: