diff --git a/backend/proteins/migrations/0056_auto_20240920_1426.py b/backend/proteins/migrations/0056_auto_20240920_1426.py index 785fa913..578ee25e 100644 --- a/backend/proteins/migrations/0056_auto_20240920_1426.py +++ b/backend/proteins/migrations/0056_auto_20240920_1426.py @@ -1,16 +1,19 @@ # Generated by Django 4.2.1 on 2024-09-20 14:26 - +import logging from contextlib import suppress from django.db import migrations from proteins.models import Spectrum +logger = logging.getLogger(__name__) + + def set_default_status(apps, schema_editor): - for spectrum in Spectrum.objects.all(): + for spectrum in Spectrum.objects.all_objects(): try: spectrum.status = Spectrum.STATUS.approved spectrum.save() - except Exception: - print(f"Failed to resave spectrum id: {spectrum.id}") + except Exception as e: + logger.error(f"Failed to resave spectrum id: {spectrum.id}", exc_info=e) class Migration(migrations.Migration):