Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Aug 22, 2018
1 parent 30fe6a5 commit 6c508fc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pybossa/api/task_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ def _file_delete(self, request, obj):
"""Delete file object."""
cls_name = self.__class__.__name__.lower()
if cls_name in self.allowed_classes_upload:
keys = obj.info.keys()
if 'file_name' in keys and 'container' in keys:
ensure_authorized_to('delete', obj)
uploader.delete_file(obj.info['file_name'],
obj.info['container'])
if type(obj.info) == dict:
keys = obj.info.keys()
if 'file_name' in keys and 'container' in keys:
ensure_authorized_to('delete', obj)
uploader.delete_file(obj.info['file_name'],
obj.info['container'])

0 comments on commit 6c508fc

Please sign in to comment.