Commit 7a8a89b4 by Szabolcs Gelencser Committed by Szabolcs Gelencsér

Fix template listing for mitaka

parent 631d0f12
...@@ -128,7 +128,7 @@ class VmFromPlainImageForm(forms.Form): ...@@ -128,7 +128,7 @@ class VmFromPlainImageForm(forms.Form):
super(VmFromPlainImageForm, self).__init__(*args, **kwargs) super(VmFromPlainImageForm, self).__init__(*args, **kwargs)
images = openstack_api.glance.image_list_detailed(request)[0] #TODO: flatten? images = openstack_api.glance.image_list_detailed(request)[0] #TODO: flatten?
images = [i for i in images if i._apiresource["visibility"] in ["private", "public"]] images = [i for i in images if i._apiresource["visibility"] in ["public",]]
def sizeof_fmt(num, suffix='B'): def sizeof_fmt(num, suffix='B'):
for unit in ['', 'K', 'M', 'G', 'T']: for unit in ['', 'K', 'M', 'G', 'T']:
......
...@@ -79,14 +79,6 @@ ...@@ -79,14 +79,6 @@
</div> </div>
</div> </div>
</div> </div>
{% empty %}
{% if not template_access_types %}
{% trans "You can't start new virtual machines because no templates are shared with you." %}
{% else %}
{% trans "You can't start new virtual machines because no templates are shared with you however you can request them via the form below." %}
<hr />
{% include "request/_request-template-form.html" %}
{% endif %}
{% endfor %} {% endfor %}
<div class="vm-create-template"> <div class="vm-create-template">
......
...@@ -1173,7 +1173,7 @@ class VmCreate(LoginRequiredMixin, TemplateView): ...@@ -1173,7 +1173,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.filter(owner_id=self.request.user.id) templates = InstanceTemplate.objects.filter(owner_id=self.request.user.tenant_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