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
7b789b37
Commit
7b789b37
authored
Apr 26, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix opds with shelves
Fix errorhandler ldap without ldap
parent
0480d493
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
53 deletions
+129
-53
opds.py
cps/opds.py
+2
-2
web.py
cps/web.py
+6
-5
Calibre-Web TestSummary.html
test/Calibre-Web TestSummary.html
+121
-46
No files found.
cps/opds.py
View file @
7b789b37
...
...
@@ -344,12 +344,12 @@ def feed_shelf(book_id):
off
=
request
.
args
.
get
(
"offset"
)
or
0
if
current_user
.
is_anonymous
:
shelf
=
ub
.
session
.
query
(
ub
.
Shelf
)
.
filter
(
ub
.
Shelf
.
is_public
==
1
,
ub
.
Shelf
.
id
==
book_id
,
not
ub
.
Shelf
.
deleted
)
.
first
()
ub
.
Shelf
.
id
==
book_id
)
.
first
()
else
:
shelf
=
ub
.
session
.
query
(
ub
.
Shelf
)
.
filter
(
or_
(
and_
(
ub
.
Shelf
.
user_id
==
int
(
current_user
.
id
),
ub
.
Shelf
.
id
==
book_id
),
and_
(
ub
.
Shelf
.
is_public
==
1
,
ub
.
Shelf
.
id
==
book_id
))
,
not
ub
.
Shelf
.
deleted
)
.
first
()
ub
.
Shelf
.
id
==
book_id
)))
.
first
()
result
=
list
()
# user is allowed to access shelf
if
shelf
:
...
...
cps/web.py
View file @
7b789b37
...
...
@@ -112,11 +112,12 @@ for ex in default_exceptions:
app
.
register_error_handler
(
ex
,
internal_error
)
# Only way of catching the LDAPException upon logging in with LDAP server down
@
app
.
errorhandler
(
services
.
ldap
.
LDAPException
)
def
handle_exception
(
e
):
log
.
debug
(
'LDAP server not accessible while trying to login to opds feed'
)
return
error_http
(
FailedDependency
())
if
feature_support
[
'ldap'
]:
# Only way of catching the LDAPException upon logging in with LDAP server down
@
app
.
errorhandler
(
services
.
ldap
.
LDAPException
)
def
handle_exception
(
e
):
log
.
debug
(
'LDAP server not accessible while trying to login to opds feed'
)
return
error_http
(
FailedDependency
())
web
=
Blueprint
(
'web'
,
__name__
)
...
...
test/Calibre-Web TestSummary.html
View file @
7b789b37
This diff is collapsed.
Click to expand it.
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