fixed bug where when you remove a sub_book it left a whole in sub_book_num's, and rewrote to new sqlalchemy 2, all the direct sqls
This commit is contained in:
5
loan.py
5
loan.py
@@ -90,9 +90,10 @@ def loan(id):
|
||||
loan = Loan.query.get(id)
|
||||
try:
|
||||
if 'delete' in request.form:
|
||||
st.SetMessage( f"Successfully deleted (id={loan.id}, who={loan.firsnames} {loan.surname})" )
|
||||
st.SetMessage( f"Successfully deleted (id={loan.id}, who={loan.firstnames} {loan.surname})" )
|
||||
# fall back to direct sql because loan.py is imported before Book_Loan_Link exists
|
||||
db.engine.execute( f"delete from book_loan_link where loan_id = {loan.id}" )
|
||||
with db.engine.connect() as conn:
|
||||
conn.exec_driver_sql( f"delete from book_loan_link where loan_id = {loan.id}" )
|
||||
loan = Loan.query.filter(Loan.id==id).delete()
|
||||
if 'submit' in request.form:
|
||||
st.SetMessage( f"Successfully Updated Loan (id={id})" )
|
||||
|
||||
Reference in New Issue
Block a user