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
317e59df
Commit
317e59df
authored
Feb 15, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes from tests
parent
a9a6f5b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
admin.py
cps/admin.py
+4
-5
kobo_auth.py
cps/kobo_auth.py
+1
-1
user_edit.html
cps/templates/user_edit.html
+1
-1
No files found.
cps/admin.py
View file @
317e59df
...
...
@@ -338,7 +338,6 @@ def restriction_deletion(element, list_func):
@
login_required
@
admin_required
def
add_restriction
(
type
):
log
.
info
(
"Hit: "
+
str
(
type
))
element
=
request
.
form
.
to_dict
()
if
type
==
0
:
# Tags as template
if
'submit_allow'
in
element
:
...
...
@@ -713,6 +712,10 @@ def new_user():
languages
=
languages
,
title
=
_
(
u"Add new user"
),
page
=
"newuser"
,
kobo_support
=
kobo_support
,
registered_oauth
=
oauth_check
)
try
:
content
.
allowed_tags
=
config
.
config_allowed_tags
content
.
denied_tags
=
config
.
config_denied_tags
content
.
allowed_column_value
=
config
.
config_allowed_column_value
content
.
denied_column_value
=
config
.
config_denied_column_value
ub
.
session
.
add
(
content
)
ub
.
session
.
commit
()
flash
(
_
(
u"User '
%(user)
s' created"
,
user
=
content
.
nickname
),
category
=
"success"
)
...
...
@@ -723,10 +726,6 @@ def new_user():
else
:
content
.
role
=
config
.
config_default_role
content
.
sidebar_view
=
config
.
config_default_show
content
.
allowed_tags
=
config
.
config_allowed_tags
content
.
denied_tags
=
config
.
config_denied_tags
content
.
allowed_column_value
=
config
.
config_allowed_column_value
content
.
allowed_column_value
=
config
.
config_denied_column_value
return
render_title_template
(
"user_edit.html"
,
new_user
=
1
,
content
=
content
,
translations
=
translations
,
languages
=
languages
,
title
=
_
(
u"Add new user"
),
page
=
"newuser"
,
kobo_support
=
kobo_support
,
registered_oauth
=
oauth_check
)
...
...
cps/kobo_auth.py
View file @
317e59df
...
...
@@ -101,7 +101,7 @@ def load_user_from_kobo_request(request):
if
user
is
not
None
:
login_user
(
user
)
return
user
log
.
info
(
"Received Kobo request without a recognizable auth token."
)
log
.
debug
(
"Received Kobo request without a recognizable auth token."
)
return
kobo_auth
=
Blueprint
(
"kobo_auth"
,
__name__
,
url_prefix
=
"/kobo_auth"
)
...
...
cps/templates/user_edit.html
View file @
317e59df
...
...
@@ -79,7 +79,7 @@
<input
type=
"checkbox"
name=
"Show_detail_random"
id=
"Show_detail_random"
{%
if
content
.
show_detail_random
()
%}
checked
{%
endif
%}
>
<label
for=
"Show_detail_random"
>
{{_('Show random books in detail view')}}
</label>
</div>
{% if ( g.user and g.user.role_admin() ) %}
{% if ( g.user and g.user.role_admin()
and not new_user
) %}
<a
href=
"#"
id=
"get_user_tags"
class=
"btn btn-default"
data-toggle=
"modal"
data-target=
"#restrictModal"
>
{{_('Add allowed/denied Tags')}}
</a>
<a
href=
"#"
id=
"get_user_column_values"
class=
"btn btn-default"
data-toggle=
"modal"
data-target=
"#restrictModal"
>
{{_('Add allowed/denied custom column values')}}
</a>
{% endif %}
...
...
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