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
95ca1e6a
Commit
95ca1e6a
authored
Apr 20, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #1319
parent
24c743d2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
59 deletions
+98
-59
editbooks.py
cps/editbooks.py
+93
-54
web.py
cps/web.py
+5
-5
No files found.
cps/editbooks.py
View file @
95ca1e6a
This diff is collapsed.
Click to expand it.
cps/web.py
View file @
95ca1e6a
...
...
@@ -23,7 +23,7 @@
from
__future__
import
division
,
print_function
,
unicode_literals
import
os
import
base64
import
datetime
from
datetime
import
datetime
import
json
import
mimetypes
import
traceback
...
...
@@ -967,14 +967,14 @@ def advanced_search():
if
pub_start
:
try
:
searchterm
.
extend
([
_
(
u"Published after "
)
+
format_date
(
datetime
.
datetime
.
strptime
(
pub_start
,
"
%
Y-
%
m-
%
d"
),
format_date
(
datetime
.
strptime
(
pub_start
,
"
%
Y-
%
m-
%
d"
),
format
=
'medium'
,
locale
=
get_locale
())])
except
ValueError
:
pub_start
=
u""
if
pub_end
:
try
:
searchterm
.
extend
([
_
(
u"Published before "
)
+
format_date
(
datetime
.
datetime
.
strptime
(
pub_end
,
"
%
Y-
%
m-
%
d"
),
format_date
(
datetime
.
strptime
(
pub_end
,
"
%
Y-
%
m-
%
d"
),
format
=
'medium'
,
locale
=
get_locale
())])
except
ValueError
:
pub_start
=
u""
...
...
@@ -1358,7 +1358,7 @@ def verify_token(token):
return
redirect
(
url_for
(
'web.index'
))
# Token expired
if
datetime
.
datetime
.
now
()
>
auth_token
.
expiration
:
if
datetime
.
now
()
>
auth_token
.
expiration
:
ub
.
session
.
delete
(
auth_token
)
ub
.
session
.
commit
()
...
...
@@ -1390,7 +1390,7 @@ def token_verified():
data
[
'message'
]
=
_
(
u"Token not found"
)
# Token expired
elif
datetime
.
datetime
.
now
()
>
auth_token
.
expiration
:
elif
datetime
.
now
()
>
auth_token
.
expiration
:
ub
.
session
.
delete
(
auth_token
)
ub
.
session
.
commit
()
...
...
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