Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt committed Dec 24, 2019
1 parent 2dc6210 commit e5a447c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arches/app/views/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def handle_save_error(self, e, tile_id="", title=_("Saving tile failed"), messag
message += ": {0}".format(e.message)
else:
message = str(e)

logger.error(
title
+ """ [Tile id: {tile_id}] \
Expand Down Expand Up @@ -166,7 +165,7 @@ def post(self, request):
response = {"status": "false", "message": [_("Request Failed"), _("Unable to Save. Verify model status is active")]}
return JSONResponse(response, status=500)
else:
return JSONErrorResponse(_('Request Failed'), _('Permission Denied'))
return JSONErrorResponse(_("Request Failed"), _("Permission Denied"))

if self.action == "reorder_tiles":
json = request.body
Expand Down Expand Up @@ -219,7 +218,7 @@ def delete(self, request):
try:
tile = Tile.objects.get(tileid=data["tileid"])
except ObjectDoesNotExist:
return JSONErrorResponse(_('This tile is no longer available'), _('It was likely already deleted by another user'))
return JSONErrorResponse(_("This tile is no longer available"), _("It was likely already deleted by another user"))
user_is_reviewer = user_is_resource_reviewer(request.user)
if (user_is_reviewer or tile.is_provisional() is True) and is_active is True:
if tile.filter_by_perm(request.user, "delete_nodegroup"):
Expand All @@ -244,12 +243,14 @@ def delete(self, request):
update_system_settings_cache(tile)
return JSONResponse(tile)
else:
return JSONErrorResponse(_('Request Failed'), _('Permission Denied'))
return JSONErrorResponse(_("Request Failed"), _("Permission Denied"))
elif is_active is False:
response = {"status": "false", "message": [_("Request Failed"), _("Unable to delete. Verify model status is active")]}
return JSONResponse(response, status=500)
else:
return JSONErrorResponse(_('Request Failed'), _('You do not have permissions to delete a tile with authoritative data.'))
return JSONErrorResponse(
_("Request Failed"), _("You do not have permissions to delete a tile with authoritative data.")
)

return HttpResponseNotFound()

Expand Down

0 comments on commit e5a447c

Please sign in to comment.