lint: various non-semantic fixes
bumping fail-under for pylint to 9.72
This commit is contained in:
parent
7a54e4ea96
commit
f6452cb4fa
14 changed files with 47 additions and 29 deletions
|
@ -74,8 +74,7 @@ def bridgeconf_new(group_id: Optional[int] = None) -> ResponseReturnValue:
|
|||
db.session.commit()
|
||||
flash(f"Created new bridge configuration {bridge_conf.id}.", "success")
|
||||
return redirect(url_for("portal.bridgeconf.bridgeconf_list"))
|
||||
except exc.SQLAlchemyError as e:
|
||||
print(e)
|
||||
except exc.SQLAlchemyError:
|
||||
flash("Failed to create new bridge configuration.", "danger")
|
||||
return redirect(url_for("portal.bridgeconf.bridgeconf_list"))
|
||||
if group_id:
|
||||
|
|
|
@ -105,8 +105,7 @@ def list_new(group_id: Optional[int] = None) -> ResponseReturnValue:
|
|||
db.session.commit()
|
||||
flash("Created new mirror list.", "success")
|
||||
return redirect(url_for("portal.list.list_list"))
|
||||
except exc.SQLAlchemyError as e:
|
||||
print(e)
|
||||
except exc.SQLAlchemyError:
|
||||
flash("Failed to create new mirror list.", "danger")
|
||||
return redirect(url_for("portal.list.list_list"))
|
||||
if group_id:
|
||||
|
|
|
@ -49,8 +49,7 @@ def onion_new(group_id: Optional[int] = None) -> ResponseReturnValue:
|
|||
db.session.commit()
|
||||
flash(f"Created new onion {onion.onion_name}.", "success")
|
||||
return redirect(url_for("portal.onion.onion_edit", onion_id=onion.id))
|
||||
except exc.SQLAlchemyError as e:
|
||||
print(e)
|
||||
except exc.SQLAlchemyError:
|
||||
flash("Failed to create new onion.", "danger")
|
||||
return redirect(url_for("portal.onion.onion_list"))
|
||||
if group_id:
|
||||
|
|
|
@ -55,8 +55,7 @@ def origin_new(group_id: Optional[int] = None) -> ResponseReturnValue:
|
|||
db.session.commit()
|
||||
flash(f"Created new origin {origin.domain_name}.", "success")
|
||||
return redirect(url_for("portal.origin.origin_edit", origin_id=origin.id))
|
||||
except exc.SQLAlchemyError as e:
|
||||
print(e)
|
||||
except exc.SQLAlchemyError:
|
||||
flash("Failed to create new origin.", "danger")
|
||||
return redirect(url_for("portal.origin.origin_list"))
|
||||
if group_id:
|
||||
|
|
|
@ -16,10 +16,10 @@ bp = Blueprint("webhook", __name__)
|
|||
|
||||
|
||||
@bp.app_template_filter("webhook_format_name")
|
||||
def webhook_format_name(format: str) -> str:
|
||||
if format == "telegram":
|
||||
def webhook_format_name(key: str) -> str:
|
||||
if key == "telegram":
|
||||
return "Telegram"
|
||||
if format == "matrix":
|
||||
if key == "matrix":
|
||||
return "Matrix"
|
||||
return "Unknown"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue