Fixes bug #913641 - Dashboard can't delete snapshots.

Change-Id: I788b02f177bc8ef66845ed6a2e9c5892a2ed7985
This commit is contained in:
Kiall Mac Innes 2012-01-13 04:02:05 +00:00
parent 1e99f1cbfc
commit 8cef264638
2 changed files with 3 additions and 3 deletions

View File

@ -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 \

View File

@ -16,7 +16,7 @@
<td>{{image.status|capfirst}}</td>
<td id="actions">
<ul>
{% if image.owner == request.user.username %}
{% if image.owner == request.user.tenant_id %}
<li class="form">{% include "django_openstack/dash/images/_delete.html" with form=delete_form %}</li>
<li><a href="{% url dash_images_update request.user.tenant_id image.id %}">Edit</a></li>
{% endif %}