Skip to content

Commit 261d155

Browse files
committed
fix(controller): return the correct domain from get_object()
1 parent 86b3b09 commit 261d155

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

controller/api/tests/test_domain.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from __future__ import unicode_literals
88

99
import json
10-
import unittest
1110

1211
from django.contrib.auth.models import User
1312
from django.test import TestCase
@@ -102,7 +101,6 @@ def test_delete_domain_does_not_remove_latest(self):
102101
with self.assertRaises(Domain.DoesNotExist):
103102
Domain.objects.get(domain=test_domains[0])
104103

105-
@unittest.skip(".get_object() returns all domains instead of the requested domain")
106104
def test_delete_domain_does_not_remove_others(self):
107105
"""https://github.com/deis/deis/issues/3475"""
108106
self.test_delete_domain_does_not_remove_latest()

controller/api/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ class DomainViewSet(AppResourceViewSet):
218218
serializer_class = serializers.DomainSerializer
219219

220220
def get_object(self, **kwargs):
221-
return self.get_queryset(**kwargs)
221+
qs = self.get_queryset(**kwargs)
222+
return qs.get(domain=self.kwargs['domain'])
222223

223224

224225
class CertificateViewSet(BaseDeisViewSet):

0 commit comments

Comments
 (0)