Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
bd4fde9e
Commit
bd4fde9e
authored
May 19, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1992 handle invalid numbers of books seriesindex
parent
c85cfa90
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
editbooks.py
cps/editbooks.py
+3
-0
jinjia.py
cps/jinjia.py
+6
-3
No files found.
cps/editbooks.py
View file @
bd4fde9e
...
...
@@ -439,6 +439,9 @@ def edit_book_series_index(series_index, book):
# Add default series_index to book
modif_date
=
False
series_index
=
series_index
or
'1'
if
not
series_index
.
replace
(
'.'
,
''
,
1
)
.
isdigit
():
flash
(
_
(
"
%(seriesindex)
s is not a valid number, skipping"
,
seriesindex
=
series_index
),
category
=
"warning"
)
return
False
if
book
.
series_index
!=
series_index
:
book
.
series_index
=
series_index
modif_date
=
True
...
...
cps/jinjia.py
View file @
bd4fde9e
...
...
@@ -122,10 +122,13 @@ def formatfloat(value, decimals=1):
@
jinjia
.
app_template_filter
(
'formatseriesindex'
)
def
formatseriesindex_filter
(
series_index
):
if
series_index
:
try
:
if
int
(
series_index
)
-
series_index
==
0
:
return
int
(
series_index
)
else
:
return
series_index
except
ValueError
:
return
series_index
return
0
@
jinjia
.
app_template_filter
(
'uuidfilter'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment