BUG-13 delete loan fails with foreign key issues, all fixed
This commit is contained in:
1
BUGs
1
BUGs
@@ -3,7 +3,6 @@
|
||||
### DB/back-end
|
||||
BUG-2: series does not deal with calcd_rating...
|
||||
- (on edit could, recalc as a catch-all, and obviously if we change a single book's rating, we should re-calc)
|
||||
BUG-13: deleting loan fails with book_loan_link data still existing
|
||||
|
||||
### UI not updating after DB change:
|
||||
BUG-3: alter a condition, covertype, etc. and its not in drop-down list (even though db look via index is correct, e.g books.html shows updated covertype)
|
||||
|
||||
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