Skip to content

Commit aaf89a6

Browse files
azhavoroFernando Martínez González
authored andcommitted
fixed linter issues (cvat-ai#1538)
1 parent 2e73ad7 commit aaf89a6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cvat/apps/dataset_manager/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def log_exception(logger=None, exc_info=True):
3030

3131

3232
def get_export_cache_dir(db_task):
33-
return osp.join(db_task.get_task_dirname(), 'export_cache')
33+
task_dir = osp.abspath(db_task.get_task_dirname())
34+
if osp.isdir(task_dir):
35+
return osp.join(task_dir, 'export_cache')
36+
else:
37+
raise Exception('Task dir {} does not exist'.format(task_dir))
3438

3539
DEFAULT_CACHE_TTL = timedelta(hours=10)
3640
CACHE_TTL = DEFAULT_CACHE_TTL

cvat/apps/engine/tests/_test_rest_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,8 +1458,9 @@ def test_api_v1_tasks_no_auth(self):
14581458

14591459
def generate_image_file(filename):
14601460
f = BytesIO()
1461-
width = random.randint(100, 800)
1462-
height = random.randint(100, 800)
1461+
gen = random.SystemRandom()
1462+
width = gen.randint(100, 800)
1463+
height = gen.randint(100, 800)
14631464
image = Image.new('RGB', size=(width, height))
14641465
image.save(f, 'jpeg')
14651466
f.name = filename

0 commit comments

Comments
 (0)