diff --git a/arkindex/documents/migrations/0024_migrate_datasource.py b/arkindex/documents/migrations/0024_migrate_datasource.py index 7ba7bd5cd8e6d46a5ffa90917d3b8b4b36369cc0..b164ee3621dd97fc87cd21f448191d5bdb19f03f 100644 --- a/arkindex/documents/migrations/0024_migrate_datasource.py +++ b/arkindex/documents/migrations/0024_migrate_datasource.py @@ -9,9 +9,12 @@ from arkindex.dataimport.models import RepositoryType def migrate_data_sources(apps, schema_editor): + DataSource = apps.get_model('documents', 'DataSource') + if not DataSource.objects.exists(): + return + repo_prefix = os.environ.get('REPOSITORY_PREFIX', 'https://gitlab.com/teklia/workers') - DataSource = apps.get_model('documents', 'DataSource') Element = apps.get_model('documents', 'Element') Classification = apps.get_model('documents', 'Classification') Transcription = apps.get_model('documents', 'Transcription')