Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed linter issues #1538

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where should this directory be created, if it is not created?

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