Add success url to instance model

This commit is contained in:
Tobias Kunze 2025-03-28 13:10:23 +01:00
parent 174837a870
commit 4e44b283b1
2 changed files with 6 additions and 0 deletions

View file

@ -49,6 +49,7 @@ class Organization(ServalaModelMixin, models.Model):
base = "/org/{self.slug}/"
details = "{base}details/"
services = "{base}services/"
services = "{base}instances/"
@cached_property
def slug(self):

View file

@ -1,4 +1,5 @@
import kubernetes
import urlman
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.db import models
@ -452,3 +453,7 @@ class ServiceInstance(ServalaModelMixin, models.Model):
# Names are unique per de-facto namespace, which is defined by the
# Organization + ServiceDefinition (group, version) + the ControlPlane.
unique_together = [("name", "organization", "context")]
class urls(urlman.Urls):
base = "{self.organization.urls.instances}{self.name}/"