This commit is contained in:
parent
d1d1352cf4
commit
d32ed1eb55
2 changed files with 6 additions and 3 deletions
|
@ -648,7 +648,11 @@ class ServiceInstance(ServalaModelMixin, models.Model):
|
||||||
if self.is_deleted:
|
if self.is_deleted:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.spec.get("parameters", {}).get("security", {}).get("deletionProtection"):
|
if (
|
||||||
|
self.spec.get("parameters", {})
|
||||||
|
.get("security", {})
|
||||||
|
.get("deletionProtection")
|
||||||
|
):
|
||||||
spec = copy.copy(self.spec)
|
spec = copy.copy(self.spec)
|
||||||
spec["parameters"]["security"]["deletionProtection"] = False
|
spec["parameters"]["security"]["deletionProtection"] = False
|
||||||
self.update_spec(spec, user)
|
self.update_spec(spec, user)
|
||||||
|
|
|
@ -384,7 +384,6 @@ class ServiceInstanceListView(OrganizationViewMixin, ListView):
|
||||||
"""Return all service instances for the current organization with filtering."""
|
"""Return all service instances for the current organization with filtering."""
|
||||||
queryset = ServiceInstance.objects.filter(
|
queryset = ServiceInstance.objects.filter(
|
||||||
organization=self.request.organization,
|
organization=self.request.organization,
|
||||||
is_deleted=False, # Exclude soft-deleted
|
|
||||||
).select_related(
|
).select_related(
|
||||||
"context__service_offering__provider",
|
"context__service_offering__provider",
|
||||||
"context__control_plane",
|
"context__control_plane",
|
||||||
|
@ -441,4 +440,4 @@ class ServiceInstanceDeleteView(
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return self.request.organization.urls.instances
|
return str(self.request.organization.urls.instances)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue