Skip to content

Commit

Permalink
fixed linter issues (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
azhavoro authored May 14, 2020
1 parent d62ae15 commit ccd2fbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cvat/apps/dataset_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def log_exception(logger=None, exc_info=True):


def get_export_cache_dir(db_task):
return osp.join(db_task.get_task_dirname(), 'export_cache')
task_dir = osp.abspath(db_task.get_task_dirname())
if osp.isdir(task_dir):
return osp.join(task_dir, 'export_cache')
else:
raise Exception('Task dir {} does not exist'.format(task_dir))

DEFAULT_CACHE_TTL = timedelta(hours=10)
CACHE_TTL = DEFAULT_CACHE_TTL
Expand Down
5 changes: 3 additions & 2 deletions cvat/apps/engine/tests/_test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,8 +1458,9 @@ def test_api_v1_tasks_no_auth(self):

def generate_image_file(filename):
f = BytesIO()
width = random.randint(100, 800)
height = random.randint(100, 800)
gen = random.SystemRandom()
width = gen.randint(100, 800)
height = gen.randint(100, 800)
image = Image.new('RGB', size=(width, height))
image.save(f, 'jpeg')
f.name = filename
Expand Down

0 comments on commit ccd2fbd

Please sign in to comment.