Show virtual machine plan page for admin
This commit is contained in:
parent
5b5239d1d4
commit
bd4d81c286
1 changed files with 6 additions and 1 deletions
|
@ -1544,7 +1544,12 @@ class VirtualMachinesPlanListView(LoginRequiredMixin, ListView):
|
||||||
ordering = '-id'
|
ordering = '-id'
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
owner = self.request.user
|
username = self.request.GET.get('username')
|
||||||
|
if self.request.user.is_admin and username:
|
||||||
|
user = CustomUser.objects.get(username=username)
|
||||||
|
else:
|
||||||
|
user = self.request.user
|
||||||
|
owner = user
|
||||||
manager = OpenNebulaManager(email=owner.username,
|
manager = OpenNebulaManager(email=owner.username,
|
||||||
password=owner.password)
|
password=owner.password)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue