List all VMs for admins
This commit is contained in:
parent
8634d667d5
commit
55bd42fe64
1 changed files with 6 additions and 1 deletions
|
@ -85,7 +85,12 @@ class VMProductViewSet(ProductViewSet):
|
||||||
serializer_class = VMProductSerializer
|
serializer_class = VMProductSerializer
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return VMProduct.objects.filter(owner=self.request.user)
|
if self.request.user.is_superuser:
|
||||||
|
obj = VMProduct.objects.all()
|
||||||
|
else:
|
||||||
|
obj = VMProduct.objects.filter(owner=self.request.user)
|
||||||
|
|
||||||
|
return obj
|
||||||
|
|
||||||
# Use a database transaction so that we do not get half-created structure
|
# Use a database transaction so that we do not get half-created structure
|
||||||
# if something goes wrong.
|
# if something goes wrong.
|
||||||
|
|
Loading…
Reference in a new issue