mirror of https://github.com/CIRCL/AIL-framework
fix: [users settings] fix user edit
parent
4dcc8c8d34
commit
b66859d639
|
@ -306,7 +306,7 @@ def create_user(user_id, password=None, admin_id=None, chg_passwd=True, role=Non
|
|||
# EDIT
|
||||
if exists_user(user_id):
|
||||
if password or chg_passwd:
|
||||
edit_user(user_id, password_hash, chg_passwd=chg_passwd)
|
||||
edit_user(user_id, password_hash, chg_passwd=chg_passwd, otp=otp)
|
||||
if role:
|
||||
edit_user_role(user_id, role)
|
||||
# CREATE USER
|
||||
|
|
|
@ -49,7 +49,12 @@
|
|||
|
||||
<h1 class="h3 mt-1 mb-3 text-center text-secondary">{% if meta['id'] %}Edit{% else %}Create{% endif %} User</h1>
|
||||
<label for="inputEmail" class="sr-only">Email address</label>
|
||||
<input type="email" id="inputEmail" name="username" class="form-control {% if error_mail %}is-invalid{% endif %}" placeholder="Email address" autocomplete="off" required {% if meta['id'] %}value="{{ meta['id'] }}"{% endif %} {% if meta['id'] %}disabled{% endif %}>
|
||||
{% if meta['id'] %}
|
||||
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" autocomplete="off" value="{{ meta['id'] }}" disabled>
|
||||
<input type="email" name="username" hidden="" value="{{ meta['id'] }}">
|
||||
{% else %}
|
||||
<input type="email" id="inputEmail" name="username" class="form-control {% if error_mail %}is-invalid{% endif %}" placeholder="Email address" autocomplete="off" required>
|
||||
{% endif %}
|
||||
{% if error_mail %}
|
||||
<div class="invalid-feedback">Please provide a valid email address</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue