removed debugs, reply with 200 OK instead of redirect that is ignored anyway
This commit is contained in:
6
README
6
README
@@ -32,6 +32,9 @@ MAYBE-1: when moving a book in a series (which is part of 2 series), do we pop-u
|
|||||||
|
|
||||||
#### TODOS (next 22):
|
#### TODOS (next 22):
|
||||||
TODO-5: should deleting really just ask if want to mark it as SOLD?
|
TODO-5: should deleting really just ask if want to mark it as SOLD?
|
||||||
|
TODO-21: allow a way to add a book as a child of another existing book (opposite of rem_sub_book)
|
||||||
|
TODO-22: adding a sub-book when the parent book is in a series, need to add a bsl for it and make it the next (probably)
|
||||||
|
|
||||||
TODO-8: show books on shelf list
|
TODO-8: show books on shelf list
|
||||||
TODO-9: show books to buy view / printable
|
TODO-9: show books to buy view / printable
|
||||||
TODO-11: show unrated books (with toggle to exclude those with missing in a series)
|
TODO-11: show unrated books (with toggle to exclude those with missing in a series)
|
||||||
@@ -47,7 +50,6 @@ TODO-18: consider which of the 'books maybe not valid' reports make sense still
|
|||||||
TODO-19: icons on wish list, etc.? (not sure I really want them, but if so)
|
TODO-19: icons on wish list, etc.? (not sure I really want them, but if so)
|
||||||
- wishlist: search-dollar OR https://www.flaticon.com/free-icon/wishlist_868517
|
- wishlist: search-dollar OR https://www.flaticon.com/free-icon/wishlist_868517
|
||||||
- save: https://www.flaticon.com/free-icon/sold_463255?term=sold&page=1&position=6&related_item_id=463255
|
- save: https://www.flaticon.com/free-icon/sold_463255?term=sold&page=1&position=6&related_item_id=463255
|
||||||
|
|
||||||
TODO-20: ORM all books load is slow
|
TODO-20: ORM all books load is slow
|
||||||
- should I lazy load all books (ajax the 2nd->last pages in, or not use ORM, and do a quick db.execute()....)
|
- should I lazy load all books (ajax the 2nd->last pages in, or not use ORM, and do a quick db.execute()....)
|
||||||
TODO-21: allow a way to add a book as a child of another existing book (opposite of rem_sub_book)
|
|
||||||
TODO-22: adding a sub-book when the parent book is in a series, need to add a bsl for it and make it the next (probably)
|
|
||||||
|
|||||||
13
main.py
13
main.py
@@ -1,4 +1,4 @@
|
|||||||
from flask import Flask, render_template, request, redirect
|
from flask import Flask, render_template, request, redirect, jsonify
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
from sqlalchemy.exc import SQLAlchemyError
|
from sqlalchemy.exc import SQLAlchemyError
|
||||||
from flask_marshmallow import Marshmallow
|
from flask_marshmallow import Marshmallow
|
||||||
@@ -588,9 +588,7 @@ def rem_books_from_loan(id):
|
|||||||
except SQLAlchemyError as e:
|
except SQLAlchemyError as e:
|
||||||
st.SetAlert("danger")
|
st.SetAlert("danger")
|
||||||
st.SetMessage("Failed to remove books from loan! -- {}".format( e.orig ))
|
st.SetMessage("Failed to remove books from loan! -- {}".format( e.orig ))
|
||||||
|
return jsonify(success=True)
|
||||||
print ("NOT SURE WHAT TO DO if we dont want output" )
|
|
||||||
return redirect("/loan/{}".format(id))
|
|
||||||
|
|
||||||
@app.route("/add_books_to_loan/<id>", methods=["POST"])
|
@app.route("/add_books_to_loan/<id>", methods=["POST"])
|
||||||
def add_books_to_loan(id):
|
def add_books_to_loan(id):
|
||||||
@@ -603,9 +601,7 @@ def add_books_to_loan(id):
|
|||||||
except SQLAlchemyError as e:
|
except SQLAlchemyError as e:
|
||||||
st.SetAlert("danger")
|
st.SetAlert("danger")
|
||||||
st.SetMessage("Failed to add books to loan! -- {}".format( e.orig ))
|
st.SetMessage("Failed to add books to loan! -- {}".format( e.orig ))
|
||||||
|
return jsonify(success=True)
|
||||||
print ("NOT SURE WHAT TO DO if we dont want output" )
|
|
||||||
return redirect("/loan/{}".format(id))
|
|
||||||
|
|
||||||
@app.route("/rem_parent_books_from_series/<pid>", methods=["POST"])
|
@app.route("/rem_parent_books_from_series/<pid>", methods=["POST"])
|
||||||
def rem_parent_books_from_series(pid):
|
def rem_parent_books_from_series(pid):
|
||||||
@@ -617,8 +613,7 @@ def rem_parent_books_from_series(pid):
|
|||||||
except SQLAlchemyError as e:
|
except SQLAlchemyError as e:
|
||||||
st.SetAlert("danger")
|
st.SetAlert("danger")
|
||||||
st.SetMessage("Failed to delete parent & sub books from ALL series! -- {}".format( e.orig ))
|
st.SetMessage("Failed to delete parent & sub books from ALL series! -- {}".format( e.orig ))
|
||||||
print ("NOT SURE WHAT TO DO if we dont want output - can we just return a 200?" )
|
return jsonify(success=True)
|
||||||
return redirect("/")
|
|
||||||
|
|
||||||
@app.route("/", methods=["GET"])
|
@app.route("/", methods=["GET"])
|
||||||
def main_page():
|
def main_page():
|
||||||
|
|||||||
Reference in New Issue
Block a user