Fixes bug #913641 - Dashboard can't delete snapshots.
Change-Id: I788b02f177bc8ef66845ed6a2e9c5892a2ed7985
This commit is contained in:
parent
1e99f1cbfc
commit
8cef264638
|
@ -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 \
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue