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
3c8bfc31
Commit
3c8bfc31
authored
Jul 23, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix change name allowd as non admin
parent
20fa9f55
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
36 deletions
+37
-36
user_edit.html
cps/templates/user_edit.html
+29
-29
web.py
cps/web.py
+8
-7
No files found.
cps/templates/user_edit.html
View file @
3c8bfc31
...
@@ -75,7 +75,6 @@
...
@@ -75,7 +75,6 @@
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
type=
"checkbox"
name=
"Show_detail_random"
id=
"Show_detail_random"
{%
if
content
.
show_detail_random
()
%}
checked
{%
endif
%}
>
<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>
<label
for=
"Show_detail_random"
>
{{_('Show Random Books in Detail View')}}
</label>
...
@@ -85,6 +84,7 @@
...
@@ -85,6 +84,7 @@
<a
href=
"#"
id=
"get_user_column_values"
data-id=
"{{content.id}}"
class=
"btn btn-default"
data-toggle=
"modal"
data-target=
"#restrictModal"
>
{{_('Add allowed/Denied Custom Column Values')}}
</a>
<a
href=
"#"
id=
"get_user_column_values"
data-id=
"{{content.id}}"
class=
"btn btn-default"
data-toggle=
"modal"
data-target=
"#restrictModal"
>
{{_('Add allowed/Denied Custom Column Values')}}
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"col-sm-6"
>
{% if g.user and g.user.role_admin() and not profile %}
{% if g.user and g.user.role_admin() and not profile %}
{% if not content.role_anonymous() %}
{% if not content.role_anonymous() %}
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
</form>
</form>
</div>
</div>
<div
class=
"modal fade"
id=
"modal_kobo_token"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"kobo_tokenModalLabel"
>
<div
class=
"modal fade"
id=
"modal_kobo_token"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"kobo_tokenModalLabel"
>
<div
class=
"modal-dialog modal-lg"
role=
"document"
>
<div
class=
"modal-dialog modal-lg"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}
{% block modal %}
{% block modal %}
...
...
cps/web.py
View file @
3c8bfc31
...
@@ -1580,19 +1580,20 @@ def logout():
...
@@ -1580,19 +1580,20 @@ def logout():
# ################################### Users own configuration #########################################################
# ################################### Users own configuration #########################################################
def
change_profile
(
kobo_support
,
local_oauth_check
,
oauth_status
,
translations
,
languages
):
def
change_profile
(
kobo_support
,
local_oauth_check
,
oauth_status
):
to_save
=
request
.
form
.
to_dict
()
to_save
=
request
.
form
.
to_dict
()
current_user
.
random_books
=
0
current_user
.
random_books
=
0
if
current_user
.
role_passwd
()
or
current_user
.
role_admin
():
if
current_user
.
role_passwd
()
or
current_user
.
role_admin
():
if
to_save
.
get
(
"password"
):
if
to_save
.
get
(
"password"
):
current_user
.
password
=
generate_password_hash
(
to_save
[
"password"
])
current_user
.
password
=
generate_password_hash
(
to_save
[
"password"
])
try
:
try
:
if
to_save
.
get
(
"allowed_tags"
,
current_user
.
allowed_tags
)
!=
current_user
.
allowed_tags
:
current_user
.
allowed_tags
=
to_save
[
"allowed_tags"
]
.
strip
()
if
to_save
.
get
(
"kindle_mail"
,
current_user
.
kindle_mail
)
!=
current_user
.
kindle_mail
:
if
to_save
.
get
(
"kindle_mail"
,
current_user
.
kindle_mail
)
!=
current_user
.
kindle_mail
:
current_user
.
kindle_mail
=
valid_email
(
to_save
[
"kindle_mail"
])
current_user
.
kindle_mail
=
valid_email
(
to_save
[
"kindle_mail"
])
if
to_save
.
get
(
"email"
,
current_user
.
email
)
!=
current_user
.
email
:
if
to_save
.
get
(
"email"
,
current_user
.
email
)
!=
current_user
.
email
:
current_user
.
email
=
check_email
(
to_save
[
"email"
])
current_user
.
email
=
check_email
(
to_save
[
"email"
])
if
current_user
.
role_admin
():
if
to_save
.
get
(
"allowed_tags"
,
current_user
.
allowed_tags
)
!=
current_user
.
allowed_tags
:
current_user
.
allowed_tags
=
to_save
[
"allowed_tags"
]
.
strip
()
if
to_save
.
get
(
"name"
,
current_user
.
name
)
!=
current_user
.
name
:
if
to_save
.
get
(
"name"
,
current_user
.
name
)
!=
current_user
.
name
:
# Query User name, if not existing, change
# Query User name, if not existing, change
current_user
.
name
=
check_username
(
to_save
[
"name"
])
current_user
.
name
=
check_username
(
to_save
[
"name"
])
...
@@ -1646,7 +1647,7 @@ def profile():
...
@@ -1646,7 +1647,7 @@ def profile():
local_oauth_check
=
{}
local_oauth_check
=
{}
if
request
.
method
==
"POST"
:
if
request
.
method
==
"POST"
:
change_profile
(
kobo_support
,
local_oauth_check
,
oauth_status
,
translations
,
languages
)
change_profile
(
kobo_support
,
local_oauth_check
,
oauth_status
)
return
render_title_template
(
"user_edit.html"
,
return
render_title_template
(
"user_edit.html"
,
translations
=
translations
,
translations
=
translations
,
profile
=
1
,
profile
=
1
,
...
...
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