lint: various non-semantic fixes
This commit is contained in:
parent
cbd80cf7b3
commit
273dcb2a8a
5 changed files with 13 additions and 13 deletions
|
@ -3,7 +3,7 @@ from datetime import datetime
|
|||
from flask import render_template, url_for, flash, redirect, Response, Blueprint
|
||||
from flask.typing import ResponseReturnValue
|
||||
from flask_wtf import FlaskForm
|
||||
from sqlalchemy import exc
|
||||
import sqlalchemy
|
||||
from wtforms import StringField, BooleanField, SubmitField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
|
@ -52,8 +52,7 @@ def group_new() -> ResponseReturnValue:
|
|||
db.session.commit()
|
||||
flash(f"Created new group {group.group_name}.", "success")
|
||||
return redirect(url_for("portal.group.group_edit", group_id=group.id))
|
||||
except exc.SQLAlchemyError as e:
|
||||
print(e)
|
||||
except sqlalchemy.exc.SQLAlchemyError:
|
||||
flash("Failed to create new group.", "danger")
|
||||
return redirect(url_for("portal.group.group_list"))
|
||||
return render_template("new.html.j2", section="group", form=form)
|
||||
|
@ -77,7 +76,7 @@ def group_edit(group_id: int) -> ResponseReturnValue:
|
|||
try:
|
||||
db.session.commit()
|
||||
flash("Saved changes to group.", "success")
|
||||
except exc.SQLAlchemyError:
|
||||
except sqlalchemy.exc.SQLAlchemyError:
|
||||
flash("An error occurred saving the changes to the group.", "danger")
|
||||
return render_template("group.html.j2",
|
||||
section="group",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue