Fix for deleting kindle mail adresee #54
This commit is contained in:
parent
eb8b9bf166
commit
0f8c308973
|
@ -21,7 +21,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="kindle_mail">Kindle E-Mail</label>
|
<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>
|
</div>
|
||||||
{% if g.user and g.user.role_admin() and not profile %}
|
{% if g.user and g.user.role_admin() and not profile %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -749,7 +749,7 @@ def profile():
|
||||||
if current_user.role_passwd() or current_user.role_admin():
|
if current_user.role_passwd() or current_user.role_admin():
|
||||||
if to_save["password"]:
|
if to_save["password"]:
|
||||||
content.password = generate_password_hash(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"]
|
content.kindle_mail = to_save["kindle_mail"]
|
||||||
if to_save["email"] and to_save["email"] != content.email:
|
if to_save["email"] and to_save["email"] != content.email:
|
||||||
content.email = to_save["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():
|
elif not "passwd_role" in to_save and content.role_passwd():
|
||||||
content.role = content.role - ub.ROLE_PASSWD
|
content.role = content.role - ub.ROLE_PASSWD
|
||||||
|
|
||||||
|
print content.role
|
||||||
|
|
||||||
if to_save["email"] and to_save["email"] != content.email:
|
if to_save["email"] and to_save["email"] != content.email:
|
||||||
content.email = to_save["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"]
|
content.kindle_mail = to_save["kindle_mail"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ub.session.commit()
|
ub.session.commit()
|
||||||
flash("User '%s' updated" % content.nickname, category="success")
|
flash("User '%s' updated" % content.nickname, category="success")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user