removed debugs, and no longer needed fix_an route
This commit is contained in:
21
main.py
21
main.py
@@ -590,7 +590,6 @@ def RemoveDuplicateSeriesInForm( book, request ):
|
||||
|
||||
cnt=1
|
||||
while f'bsl-book_id-{cnt}' in request.form:
|
||||
print( f"cnt={cnt}, found series id = {request.form[f'bsl-series_id-{cnt}']} " )
|
||||
if request.form[ f"bsl-series_id-{cnt}"] not in processed:
|
||||
if book.IsParent():
|
||||
newbsl=Book_Series_Link( book_id=book.id, series_id=request.form[f'bsl-series_id-{cnt}'] )
|
||||
@@ -669,7 +668,6 @@ def new_book():
|
||||
if 'parent_id' in request.form:
|
||||
parent=Book.query.get(request.form['parent_id'])
|
||||
max_bsbl = Book_Sub_Book_Link.query.filter(Book_Sub_Book_Link.book_id==parent.id).order_by(desc(Book_Sub_Book_Link.sub_book_num)).first()
|
||||
print( f"max_bsbl={max_bsbl}" )
|
||||
max_sbn=max_bsbl.sub_book_num
|
||||
if max_sbn == None:
|
||||
max_sbn=0
|
||||
@@ -1099,25 +1097,6 @@ def poor_rating_books():
|
||||
books = Book.query.join(Rating).join(Owned).filter(Rating.id>6,Rating.name!='Undefined',Owned.name=='Currently Owned').all()
|
||||
return render_template("books.html", books=books, page_title="Books that have a Poor Rating (<5 out of 10)", show_cols='Rating', hide_cols='' )
|
||||
|
||||
|
||||
@app.route("/fix_an")
|
||||
@login_required
|
||||
def fix_an():
|
||||
print("A")
|
||||
books=Book.query.all();
|
||||
print("B")
|
||||
for b in books:
|
||||
print( f"process {b.title}")
|
||||
cnt=1
|
||||
for a in b.bals:
|
||||
print( f"process bal {cnt} for {b.title}")
|
||||
a.author_num=cnt
|
||||
db.session.add(a)
|
||||
cnt+=1
|
||||
db.session.commit()
|
||||
return render_template("base.html", alert="success", message="Fixed author numbering" )
|
||||
|
||||
|
||||
# default page, just the navbar
|
||||
@app.route("/", methods=["GET"])
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user