We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3766108 commit 72c08aeCopy full SHA for 72c08ae
backend/proteins/migrations/0056_auto_20240920_1426.py
@@ -1,16 +1,19 @@
1
# Generated by Django 4.2.1 on 2024-09-20 14:26
2
-
+import logging
3
from contextlib import suppress
4
from django.db import migrations
5
from proteins.models import Spectrum
6
7
+logger = logging.getLogger(__name__)
8
+
9
10
def set_default_status(apps, schema_editor):
- for spectrum in Spectrum.objects.all():
11
+ for spectrum in Spectrum.objects.all_objects():
12
try:
13
spectrum.status = Spectrum.STATUS.approved
14
spectrum.save()
- except Exception:
- print(f"Failed to resave spectrum id: {spectrum.id}")
15
+ except Exception as e:
16
+ logger.error(f"Failed to resave spectrum id: {spectrum.id}", exc_info=e)
17
18
class Migration(migrations.Migration):
19
0 commit comments