aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newspipe/templates/admin/create_user.html2
-rw-r--r--newspipe/web/views/admin.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/newspipe/templates/admin/create_user.html b/newspipe/templates/admin/create_user.html
index 2cfe4518..550cfd1f 100644
--- a/newspipe/templates/admin/create_user.html
+++ b/newspipe/templates/admin/create_user.html
@@ -9,7 +9,7 @@
{{ form.nickname(class_="form-control") }} {% for error in form.nickname.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
{{ form.password.label }}
- {{ form.password(class_="form-control") }} {% for error in form.password.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
+ {% if pw_disabled %}{{ form.password(class_="form-control",disabled=True) }}{% else %}{{ form.password(class_="form-control") }}{% endif %} {% for error in form.password.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
{{ form.automatic_crawling.label }}
{{ form.automatic_crawling(class_="form-check-input") }} {% for error in form.automatic_crawling.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
diff --git a/newspipe/web/views/admin.py b/newspipe/web/views/admin.py
index b35a3f96..6f412901 100644
--- a/newspipe/web/views/admin.py
+++ b/newspipe/web/views/admin.py
@@ -46,10 +46,12 @@ def user_form(user_id=None):
user = UserController().get(id=user_id)
form = UserForm(obj=user)
message = gettext("Edit the user <i>%(nick)s</i>", nick=user.nickname)
+ if user.external_auth:
+ message += f" (external auth type: {user.external_auth})"
else:
form = UserForm()
message = gettext("Add a new user")
- return render_template("/admin/create_user.html", form=form, message=message)
+ return render_template("/admin/create_user.html", form=form, message=message, pw_disabled = bool(user.external_auth))
@admin_bp.route("/user/create", methods=["POST"])
bgstack15