aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/web_ui')
-rw-r--r--src/hydrilla/proxy/web_ui/packages.py7
-rw-r--r--src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja5
2 files changed, 9 insertions, 3 deletions
diff --git a/src/hydrilla/proxy/web_ui/packages.py b/src/hydrilla/proxy/web_ui/packages.py
index 1edddc0..31d3dbb 100644
--- a/src/hydrilla/proxy/web_ui/packages.py
+++ b/src/hydrilla/proxy/web_ui/packages.py
@@ -175,8 +175,11 @@ def alter_package_version(mapping_version_id: str) -> werkzeug.Response:
if action == 'install_package':
mapping_version_ref.install()
elif action == 'uninstall_package':
- mapping_version_ref.uninstall()
- return flask.redirect(flask.url_for('.packages'))
+ mapping_version_ref = mapping_version_ref.uninstall()
+ if mapping_version_ref is None:
+ return flask.redirect(flask.url_for('.packages'))
+ else:
+ return show_package_version(mapping_version_id)
else:
raise ValueError()
except st.FileInstallationError:
diff --git a/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja b/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja
index f3ed206..2c6863b 100644
--- a/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja
@@ -48,7 +48,10 @@ in a proprietary work, I am not going to enforce this in court.
<div>
{{ _('web_ui.packages.single_version.package_is_installed') }}
</div>
- {% if uninstall_disallowed is not defined %}
+ {%
+ if uninstall_disallowed is not defined and
+ display_info.active != ActiveStatus.REQUIRED
+ %}
<form method="POST">
<input name="action" value="uninstall_package" type="hidden">
<button class="green-button">