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
fa95d064
Commit
fa95d064
authored
Dec 12, 2020
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix get_sidebar_config
parent
1905e0ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
admin.py
cps/admin.py
+2
-2
render_template.py
cps/render_template.py
+2
-2
No files found.
cps/admin.py
View file @
fa95d064
...
...
@@ -42,7 +42,7 @@ from . import constants, logger, helper, services
from
.
import
db
,
calibre_db
,
ub
,
web_server
,
get_locale
,
config
,
updater_thread
,
babel
,
gdriveutils
from
.helper
import
check_valid_domain
,
send_test_mail
,
reset_password
,
generate_password_hash
from
.gdriveutils
import
is_gdrive_ready
,
gdrive_support
from
.render_template
import
render_title_template
from
.render_template
import
render_title_template
,
get_sidebar_config
from
.
import
debug_info
try
:
...
...
@@ -1050,7 +1050,7 @@ def _handle_edit_user(to_save, content,languages, translations, kobo_support):
content
.
role
&=
~
constants
.
ROLE_ANONYMOUS
val
=
[
int
(
k
[
5
:])
for
k
in
to_save
if
k
.
startswith
(
'show_'
)]
sidebar
=
ub
.
get_sidebar_config
()
sidebar
=
get_sidebar_config
()
for
element
in
sidebar
:
value
=
element
[
'visibility'
]
if
value
in
val
and
not
content
.
check_visibility
(
value
):
...
...
cps/render_template.py
View file @
fa95d064
...
...
@@ -25,7 +25,7 @@ from . import config, constants
from
.ub
import
User
def
_
get_sidebar_config
(
kwargs
=
None
):
def
get_sidebar_config
(
kwargs
=
None
):
kwargs
=
kwargs
or
[]
if
'content'
in
kwargs
:
content
=
kwargs
[
'content'
]
...
...
@@ -93,7 +93,7 @@ def _get_sidebar_config(kwargs=None):
# Returns the template for rendering and includes the instance name
def
render_title_template
(
*
args
,
**
kwargs
):
sidebar
=
_
get_sidebar_config
(
kwargs
)
sidebar
=
get_sidebar_config
(
kwargs
)
return
render_template
(
instance
=
config
.
config_calibre_web_title
,
sidebar
=
sidebar
,
accept
=
constants
.
EXTENSIONS_UPLOAD
,
*
args
,
**
kwargs
)
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