Skip to content

Commit

Permalink
Fix Pylint warnings in migrations (#8869)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecLad authored Dec 24, 2024
1 parent 2fd48c8 commit d966c1e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cvat/apps/engine/migrations/0024_auto_20191023_1025.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def migrate_task_data(db_task_id, db_data_id, original_video, original_images, s
compressed_chunk_path = os.path.join(compressed_cache_dir, '{}.zip'.format(chunk_idx))
compressed_chunk_writer.save_as_chunk(chunk_images, compressed_chunk_path)

preview = reader.get_preview()
preview = reader.get_preview(0)
preview.save(os.path.join(db_data_dir, 'preview.jpeg'))
else:
original_chunk_writer = ZipChunkWriter(100)
Expand Down Expand Up @@ -146,7 +146,7 @@ def migrate_task_data(db_task_id, db_data_id, original_video, original_images, s
original_chunk_path = os.path.join(original_cache_dir, '{}.zip'.format(chunk_idx))
original_chunk_writer.save_as_chunk(chunk_images, original_chunk_path)

preview = reader.get_preview()
preview = reader.get_preview(0)
preview.save(os.path.join(db_data_dir, 'preview.jpeg'))
shutil.rmtree(old_db_task_dir)
return_dict[db_task_id] = (True, '')
Expand Down
12 changes: 6 additions & 6 deletions cvat/apps/engine/migrations/0034_auto_20201125_1426.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import django.db.models.deletion

def create_profile(apps, schema_editor):
User = apps.get_model('auth', 'User')
Profile = apps.get_model('engine', 'Profile')
for user in User.objects.all():
profile = Profile()
profile.user = user
profile.save()
User = apps.get_model('auth', 'User')
Profile = apps.get_model('engine', 'Profile')
for user in User.objects.all():
profile = Profile()
profile.user = user
profile.save()

class Migration(migrations.Migration):

Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/migrations/0038_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def migrate2manifest(apps, shema_editor):

if db_data.storage == StorageChoice.SHARE:
def _get_frame_step(str_):
match = search("step\s*=\s*([1-9]\d*)", str_)
match = search(r"step\s*=\s*([1-9]\d*)", str_)
return int(match.group(1)) if match else 1
logger.info('Data is located on the share, metadata update has been started')
manifest.step = _get_frame_step(db_data.frame_filter)
Expand Down

0 comments on commit d966c1e

Please sign in to comment.