def handle(self, request, data): image_id = data['image_id'] try: api.image_delete(request, image_id) except tank_exception.ClientConnectionError, e: LOG.exception("Error connecting to tank") messages.error(request, _("Error connecting to tank: %s") % e.message)
def handle(self, request, data): image_id = data['image_id'] tenant_id = request.user.tenant_id try: image = api.image_get_meta(request, image_id) if image.owner == request.user.username: api.image_delete(request, image_id) else: messages.info(request, _("Unable to delete image, you are not \ its owner.")) return redirect('dash_images_update', tenant_id, image_id) except tank_exception.ClientConnectionError, e: LOG.exception("Error connecting to tank") messages.error(request, _("Error connecting to tank: %s") % e.message)
def handle(self, request, data): image_id = data['image_id'] tenant_id = request.user.tenant_id try: image = api.image_get_meta(request, image_id) if image.owner == request.user.username: api.image_delete(request, image_id) else: messages.info( request, _("Unable to delete image, you are not \ its owner.")) return redirect('dash_images_update', tenant_id, image_id) except tank_exception.ClientConnectionError, e: LOG.exception("Error connecting to tank") messages.error(request, _("Error connecting to tank: %s") % e.message)