update to use user: 2000:2000 / ARGS in build, and use the python image instead of a full ubuntu image. Also use r to escape regex str
This commit is contained in:
8
main.py
8
main.py
@@ -829,7 +829,7 @@ def book(id):
|
||||
removing_series=[]
|
||||
for field in request.form:
|
||||
if 'removed-book_num' in field:
|
||||
cnt=int(re.findall( '\d+', field )[0])
|
||||
cnt=int(re.findall( r'\d+', field )[0])
|
||||
removing_series.append( { 'series_id' : request.form['removed-series_id-{}'.format(cnt)] } )
|
||||
|
||||
if book.IsParent():
|
||||
@@ -865,7 +865,7 @@ def book(id):
|
||||
# reset rating on this/these series as the book has changed (and maybe the rating has changed)
|
||||
for field in request.form:
|
||||
if 'bsl-book_id-' in field and field != 'bsl-book_id-NUM':
|
||||
cnt=int(re.findall( '\d+', field )[0])
|
||||
cnt=int(re.findall( r'\d+', field )[0])
|
||||
s=Series.query.get(request.form['bsl-series_id-{}'.format(cnt)])
|
||||
s.calcd_rating = CalcAvgRating(s.id)
|
||||
cnt=cnt+1
|
||||
@@ -942,7 +942,7 @@ def stats():
|
||||
@login_required
|
||||
def rem_books_from_loan(id):
|
||||
for field in request.form:
|
||||
rem_id=int(re.findall( '\d+', field )[0])
|
||||
rem_id=int(re.findall( r'\d+', field )[0])
|
||||
bll = Book_Loan_Link.query.filter(Book_Loan_Link.loan_id==id, Book_Loan_Link.book_id == rem_id ).one()
|
||||
db.session.delete(bll)
|
||||
db.session.commit()
|
||||
@@ -952,7 +952,7 @@ def rem_books_from_loan(id):
|
||||
@login_required
|
||||
def add_books_to_loan(id):
|
||||
for field in request.form:
|
||||
add_id=int(re.findall( '\d+', field )[0])
|
||||
add_id=int(re.findall( r'\d+', field )[0])
|
||||
bll = Book_Loan_Link( loan_id=id, book_id=add_id )
|
||||
db.session.add(bll)
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user