Remove code smells
This commit is contained in:
parent
88ea2a44d3
commit
9ade5ecc7a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import logging
|
||||
|
||||
# from sqlalchemy import select
|
||||
|
||||
from obs.api.app import api
|
||||
|
||||
from sanic.response import json
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -211,7 +211,7 @@ async def put_track(req, slug: str):
|
|||
|
||||
try:
|
||||
body = req.json["track"]
|
||||
except:
|
||||
except BaseException:
|
||||
body = {}
|
||||
|
||||
if "title" in body:
|
||||
|
|
Loading…
Reference in a new issue