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
0f8c3089
Commit
0f8c3089
authored
Aug 08, 2016
by
Cervinko Cera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for deleting kindle mail adresee #54
parent
eb8b9bf1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
user_edit.html
cps/templates/user_edit.html
+1
-1
web.py
cps/web.py
+5
-2
No files found.
cps/templates/user_edit.html
View file @
0f8c3089
...
...
@@ -21,7 +21,7 @@
{% endif %}
<div
class=
"form-group"
>
<label
for=
"kindle_mail"
>
Kindle E-Mail
</label>
<input
type=
"
text
"
class=
"form-control"
name=
"kindle_mail"
id=
"kindle_mail"
value=
"{{ content.kindle_mail if content.kindle_mail != None }}"
>
<input
type=
"
email
"
class=
"form-control"
name=
"kindle_mail"
id=
"kindle_mail"
value=
"{{ content.kindle_mail if content.kindle_mail != None }}"
>
</div>
{% if g.user and g.user.role_admin() and not profile %}
<div
class=
"form-group"
>
...
...
cps/web.py
View file @
0f8c3089
...
...
@@ -749,7 +749,7 @@ def profile():
if
current_user
.
role_passwd
()
or
current_user
.
role_admin
():
if
to_save
[
"password"
]:
content
.
password
=
generate_password_hash
(
to_save
[
"password"
])
if
to_save
[
"kindle_mail"
]
and
to_save
[
"kindle_mail"
]
!=
content
.
kindle_mail
:
if
"kindle_mail"
in
to_save
and
to_save
[
"kindle_mail"
]
!=
content
.
kindle_mail
:
content
.
kindle_mail
=
to_save
[
"kindle_mail"
]
if
to_save
[
"email"
]
and
to_save
[
"email"
]
!=
content
.
email
:
content
.
email
=
to_save
[
"email"
]
...
...
@@ -870,10 +870,13 @@ def edit_user(user_id):
elif
not
"passwd_role"
in
to_save
and
content
.
role_passwd
():
content
.
role
=
content
.
role
-
ub
.
ROLE_PASSWD
print
content
.
role
if
to_save
[
"email"
]
and
to_save
[
"email"
]
!=
content
.
email
:
content
.
email
=
to_save
[
"email"
]
if
to_save
[
"kindle_mail"
]
and
to_save
[
"kindle_mail"
]
!=
content
.
kindle_mail
:
if
"kindle_mail"
in
to_save
and
to_save
[
"kindle_mail"
]
!=
content
.
kindle_mail
:
content
.
kindle_mail
=
to_save
[
"kindle_mail"
]
try
:
ub
.
session
.
commit
()
flash
(
"User '
%
s' updated"
%
content
.
nickname
,
category
=
"success"
)
...
...
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