summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiall Mac Innes <kiall@managedit.ie>2012-01-13 04:02:05 +0000
committerKiall Mac Innes <kiall@managedit.ie>2012-01-23 13:52:29 +0000
commit8cef264638c8f6dac690d30f821378ad56a5f7d3 (patch)
tree8e846b15d0dadfff82098581d0d584f84d0abb6b
parent1e99f1cbfcd96d3818714722a54f2c6a5f7d71ca (diff)
Fixes bug #913641 - Dashboard can't delete snapshots.diablo-eol
Notes
Notes (review): Verified+1: Jenkins Approved+1: Chuck Short <chuck.short@canonical.com> Code-Review+2: Chuck Short <chuck.short@canonical.com> Code-Review+1: Devin Carlen <devin.carlen@gmail.com> Code-Review+1: Kiall Mac Innes <kiall@managedit.ie> Code-Review+1: Jake Dahn <jake@ansolabs.com> Submitted-by: Jenkins Submitted-at: Mon, 23 Jan 2012 23:37:30 +0000 Reviewed-on: https://review.openstack.org/3028 Project: openstack/horizon Branch: refs/heads/stable/diablo
-rw-r--r--django-openstack/django_openstack/dash/views/images.py4
-rw-r--r--django-openstack/django_openstack/templates/django_openstack/dash/images/_list.html2
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 ccac7cf..7406328 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):
68 LOG.exception(error_retrieving) 68 LOG.exception(error_retrieving)
69 messages.error(request, error_retrieving) 69 messages.error(request, error_retrieving)
70 70
71 if image.owner == request.user.username: 71 if image.owner == request.user.tenant_id:
72 try: 72 try:
73 meta = { 73 meta = {
74 'is_public': True, 74 'is_public': True,
@@ -185,7 +185,7 @@ class DeleteImage(forms.SelfHandlingForm):
185 tenant_id = request.user.tenant_id 185 tenant_id = request.user.tenant_id
186 try: 186 try:
187 image = api.image_get(request, image_id) 187 image = api.image_get(request, image_id)
188 if image.owner == request.user.username: 188 if image.owner == request.user.tenant_id:
189 api.image_delete(request, image_id) 189 api.image_delete(request, image_id)
190 else: 190 else:
191 messages.info(request, "Unable to delete image, you are not \ 191 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 5e4b25f..c89db56 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 @@
16 <td>{{image.status|capfirst}}</td> 16 <td>{{image.status|capfirst}}</td>
17 <td id="actions"> 17 <td id="actions">
18 <ul> 18 <ul>
19 {% if image.owner == request.user.username %} 19 {% if image.owner == request.user.tenant_id %}
20 <li class="form">{% include "django_openstack/dash/images/_delete.html" with form=delete_form %}</li> 20 <li class="form">{% include "django_openstack/dash/images/_delete.html" with form=delete_form %}</li>
21 <li><a href="{% url dash_images_update request.user.tenant_id image.id %}">Edit</a></li> 21 <li><a href="{% url dash_images_update request.user.tenant_id image.id %}">Edit</a></li>
22 {% endif %} 22 {% endif %}