diff options
author | B. Stack <bgstack15@gmail.com> | 2023-06-18 11:50:17 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-06-24 08:23:00 -0400 |
commit | ab5ab11b68b359de2a443e464affd244bea53096 (patch) | |
tree | a521f4fdcc2bb1cc1681d93896ac0ea5d84cae19 | |
parent | add better branding, and do not use git for version (diff) | |
download | newspipe-ab5ab11b68b359de2a443e464affd244bea53096.tar.gz newspipe-ab5ab11b68b359de2a443e464affd244bea53096.tar.bz2 newspipe-ab5ab11b68b359de2a443e464affd244bea53096.zip |
display external-auth on user for admin edit-user page
-rw-r--r-- | newspipe/templates/admin/create_user.html | 2 | ||||
-rw-r--r-- | newspipe/web/views/admin.py | 4 |
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"]) |