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
d5ed5cd6
Commit
d5ed5cd6
authored
Dec 12, 2020
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes from tests
parent
fa95d064
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8015 additions
and
1499 deletions
+8015
-1499
cps.py
cps.py
+6
-2
admin.py
cps/admin.py
+2
-2
error_handler.py
cps/error_handler.py
+13
-12
opds.py
cps/opds.py
+1
-1
admin.html
cps/templates/admin.html
+1
-1
Calibre-Web TestSummary_Linux.html
test/Calibre-Web TestSummary_Linux.html
+7992
-1481
No files found.
cps.py
View file @
d5ed5cd6
...
...
@@ -41,6 +41,7 @@ from cps.shelf import shelf
from
cps.admin
import
admi
from
cps.gdrive
import
gdrive
from
cps.editbooks
import
editbook
from
cps.error_handler
import
init_errorhandler
try
:
from
cps.kobo
import
kobo
,
get_kobo_activated
...
...
@@ -58,14 +59,17 @@ except ImportError:
def
main
():
app
=
create_app
()
init_errorhandler
()
app
.
register_blueprint
(
web
)
app
.
register_blueprint
(
opds
)
app
.
register_blueprint
(
jinjia
)
app
.
register_blueprint
(
about
)
app
.
register_blueprint
(
shelf
)
app
.
register_blueprint
(
admi
)
if
config
.
config_use_google_drive
:
app
.
register_blueprint
(
gdrive
)
#
if config.config_use_google_drive:
app
.
register_blueprint
(
gdrive
)
app
.
register_blueprint
(
editbook
)
if
kobo_available
:
app
.
register_blueprint
(
kobo
)
...
...
cps/admin.py
View file @
d5ed5cd6
...
...
@@ -1327,7 +1327,7 @@ def import_ldap_users():
try
:
new_users
=
services
.
ldap
.
get_group_members
(
config
.
config_ldap_group_name
)
except
(
services
.
ldap
.
LDAPException
,
TypeError
,
AttributeError
,
KeyError
)
as
e
:
log
.
exception
(
e
)
log
.
debug_or_
exception
(
e
)
showtext
[
'text'
]
=
_
(
u'Error:
%(ldaperror)
s'
,
ldaperror
=
e
)
return
json
.
dumps
(
showtext
)
if
not
new_users
:
...
...
@@ -1355,7 +1355,7 @@ def import_ldap_users():
try
:
user_data
=
services
.
ldap
.
get_object_details
(
user
=
user_identifier
,
query_filter
=
query_filter
)
except
AttributeError
as
e
:
log
.
exception
(
e
)
log
.
debug_or_
exception
(
e
)
continue
if
user_data
:
user_login_field
=
extract_dynamic_field_from_filter
(
user
,
config
.
config_ldap_user_object
)
...
...
cps/error_handler.py
View file @
d5ed5cd6
...
...
@@ -48,20 +48,21 @@ def internal_error(error):
instance
=
config
.
config_calibre_web_title
),
500
# http error handling
for
ex
in
default_exceptions
:
if
ex
<
500
:
app
.
register_error_handler
(
ex
,
error_http
)
elif
ex
==
500
:
app
.
register_error_handler
(
ex
,
internal_error
)
def
init_errorhandler
():
# http error handling
for
ex
in
default_exceptions
:
if
ex
<
500
:
app
.
register_error_handler
(
ex
,
error_http
)
elif
ex
==
500
:
app
.
register_error_handler
(
ex
,
internal_error
)
if
services
.
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
())
if
services
.
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
())
# @app.errorhandler(InvalidRequestError)
...
...
cps/opds.py
View file @
d5ed5cd6
...
...
@@ -28,7 +28,7 @@ from functools import wraps
from
flask
import
Blueprint
,
request
,
render_template
,
Response
,
g
,
make_response
,
abort
from
flask_login
import
current_user
from
sqlalchemy.sql.expression
import
func
,
text
,
or_
,
and_
from
werkzeug.security
import
check_password_hash
from
.
import
constants
,
logger
,
config
,
db
,
calibre_db
,
ub
,
services
,
get_locale
,
isoLanguages
from
.helper
import
get_download_link
,
get_book_cover
...
...
cps/templates/admin.html
View file @
d5ed5cd6
...
...
@@ -75,7 +75,7 @@
</div>
</div>
{% endif %}
<div
class=
"btn btn-default emailconfig"
><a
id=
"basic_config"
href=
"{{url_for('admin.configuration')}}"
>
{{_('Edit Basic Configuration
')}}
</a></div>
<div
class=
"btn btn-default emailconfig"
id=
"admin_edit_email"
><a
href=
"{{url_for('admin.edit_mailsettings')}}"
>
{{_('Edit E-mail Server Settings
')}}
</a></div>
</div>
</div>
...
...
test/Calibre-Web TestSummary_Linux.html
View file @
d5ed5cd6
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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