Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle sudo connection in the account view #516

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions omeroweb/webadmin/templates/webadmin/myaccount.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@
</div>


<form class="standard_form settings_form" action="{% url 'wamyaccount' "save" %}" method="POST">{% csrf_token %}
<form class="standard_form settings_form" action="{% url 'wamyaccount' "save" %}" method="POST"
{% if isSudo %} inert {% endif %}
>{% csrf_token %}

<div id="personal_details">
<div id="personal_details" {% if isSudo %} style="opacity: 50%;" {% endif %}>

{% for field in form %}
{% if field.errors %}<div style="clear:both">{{ field.errors }}</div>{% endif %}
Expand All @@ -308,7 +310,6 @@
</div>
{% endif %}


<input type="submit" value="{% trans 'Save' %}" />
</div>
<div style="clear:both"></div>
Expand Down
2 changes: 2 additions & 0 deletions omeroweb/webadmin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ def my_account(request, action=None, conn=None, **kwargs):
isLdapUser,
hasAvatar,
) = prepare_experimenter(conn)
isSudo = conn.getEventContext().sudoerId is not None
try:
defaultGroupId = defaultGroup.id
except Exception:
Expand Down Expand Up @@ -1092,6 +1093,7 @@ def my_account(request, action=None, conn=None, **kwargs):
context = {
"form": form,
"ldapAuth": isLdapUser,
"isSudo": isSudo,
"experimenter": experimenter,
"ownedGroups": ownedGroups,
"password_form": password_form,
Expand Down
Loading