Commit 5e8cf4ed authored by lukas.burgey's avatar lukas.burgey
Browse files

Adapt to changes to User.services

parent 4cbfb0bf
Pipeline #81768 failed with stage
in 1 minute and 46 seconds
......@@ -95,7 +95,7 @@ class BaseTestCase(TestCase):
).save()
@classmethod
def tearDownClass(cls):
def tearDownTestData(cls):
# delete in reverse order
for member in [
'key',
......
......@@ -191,7 +191,15 @@ class DeploymentView(generics.RetrieveUpdateAPIView):
if self.kwargs['type'] == 'service':
try:
service = self.request.user.services.get(id=dep_id)
# find service with id dep_id
service = None
for s in self.request.user.services:
if s.id == dep_id:
if service is None:
service = s
else:
raise Exception('user has multiple services with identical id')
dep, created = ServiceDeployment.objects.get_or_create(
user=self.request.user,
service=service,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment