BUG-13 delete loan fails with foreign key issues, all fixed
This commit is contained in:
2
loan.py
2
loan.py
@@ -87,6 +87,8 @@ def loan(id):
|
||||
try:
|
||||
if 'delete' in request.form:
|
||||
st.SetMessage("Successfully deleted (id={}, who={} {})".format( loan.id, loan.firstnames, loan.surname ) )
|
||||
# fall back to direct sql because loan.py is imported before Book_Loan_Link exists
|
||||
db.engine.execute("delete from book_loan_link where loan_id = {}".format( loan.id ))
|
||||
loan = Loan.query.filter(Loan.id==id).delete()
|
||||
if 'submit' in request.form:
|
||||
st.SetMessage("Successfully Updated Loan (id={})".format(id) )
|
||||
|
||||
Reference in New Issue
Block a user