From 8cef264638c8f6dac690d30f821378ad56a5f7d3 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Fri, 13 Jan 2012 04:02:05 +0000 Subject: [PATCH] Fixes bug #913641 - Dashboard can't delete snapshots. Change-Id: I788b02f177bc8ef66845ed6a2e9c5892a2ed7985 --- django-openstack/django_openstack/dash/views/images.py | 4 ++-- .../templates/django_openstack/dash/images/_list.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django-openstack/django_openstack/dash/views/images.py b/django-openstack/django_openstack/dash/views/images.py index ccac7cf413..7406328dbc 100644 --- a/django-openstack/django_openstack/dash/views/images.py +++ b/django-openstack/django_openstack/dash/views/images.py @@ -68,7 +68,7 @@ class UpdateImageForm(forms.SelfHandlingForm): LOG.exception(error_retrieving) messages.error(request, error_retrieving) - if image.owner == request.user.username: + if image.owner == request.user.tenant_id: try: meta = { 'is_public': True, @@ -185,7 +185,7 @@ class DeleteImage(forms.SelfHandlingForm): tenant_id = request.user.tenant_id try: image = api.image_get(request, image_id) - if image.owner == request.user.username: + if image.owner == request.user.tenant_id: api.image_delete(request, image_id) else: messages.info(request, "Unable to delete image, you are not \ diff --git a/django-openstack/django_openstack/templates/django_openstack/dash/images/_list.html b/django-openstack/django_openstack/templates/django_openstack/dash/images/_list.html index 5e4b25f6a9..c89db56602 100644 --- a/django-openstack/django_openstack/templates/django_openstack/dash/images/_list.html +++ b/django-openstack/django_openstack/templates/django_openstack/dash/images/_list.html @@ -16,7 +16,7 @@ {{image.status|capfirst}}