Skip to content

Commit

Permalink
fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Sep 24, 2024
1 parent 3766108 commit 72c08ae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backend/proteins/migrations/0056_auto_20240920_1426.py
Original file line number Diff line number Diff line change
@@ -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):

Expand Down

0 comments on commit 72c08ae

Please sign in to comment.