Commit 1d8b8edb by Szabolcs Gelencser

Fix template listing: show ususers templates only

parent 797acc3f
...@@ -268,7 +268,7 @@ class TemplateList(LoginRequiredMixin, FilterMixin, SingleTableView): ...@@ -268,7 +268,7 @@ class TemplateList(LoginRequiredMixin, FilterMixin, SingleTableView):
return super(TemplateList, self).get(*args, **kwargs) return super(TemplateList, self).get(*args, **kwargs)
def get_queryset(self): def get_queryset(self):
return InstanceTemplate.objects.all() return InstanceTemplate.objects.filter(owner_id=self.request.user.id)
class TemplateDelete(DeleteViewBase): class TemplateDelete(DeleteViewBase):
model = InstanceTemplate model = InstanceTemplate
......
...@@ -1156,7 +1156,7 @@ class VmCreate(LoginRequiredMixin, TemplateView): ...@@ -1156,7 +1156,7 @@ class VmCreate(LoginRequiredMixin, TemplateView):
if form is None: if form is None:
form = self.form_class(user=request.user, template=template) form = self.form_class(user=request.user, template=template)
else: else:
templates = InstanceTemplate.objects templates = InstanceTemplate.objects.filter(owner_id=self.request.user.id)
images = openstack_api.glance.image_list_detailed(request) images = openstack_api.glance.image_list_detailed(request)
......
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 sign in to comment