Skip to content

Commit

Permalink
Made changed in migration files
Browse files Browse the repository at this point in the history
Made changes in migration files to avoid error in timezone data, since Django 5.0.2 has removed the django.utils.timezone.utc alias to datetime.timezone.utc
  • Loading branch information
dependabot[bot] authored and Gunvor4 committed Feb 8, 2024
1 parent c8af5d7 commit 07a3933
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 35 deletions.
5 changes: 2 additions & 3 deletions src/contentbox/migrations/0008_contentbox_last_modified.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='contentbox',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
5 changes: 2 additions & 3 deletions src/faq/migrations/0003_question_last_modified.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='question',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,13 +14,13 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='committee',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='inheritancegroup',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,13 +14,13 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='member',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='systemaccess',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-26 01:43

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,25 +14,25 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='machine',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='machineusagerule',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='printer3dcourse',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='reservationrule',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
4 changes: 1 addition & 3 deletions src/make_queue/migrations/0030_machine_info_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
from datetime import datetime
from django.db import migrations, models
import django.utils.timezone
from django.utils.timezone import utc


def set_info_message_date_for_existing_machines(apps, schema_editor):
Machine = apps.get_model('make_queue', 'Machine')
Machine.objects.update(info_message_date=datetime.utcfromtimestamp(0).replace(tzinfo=utc))
Machine.objects.update(info_message_date=datetime.utcfromtimestamp(0))


class Migration(migrations.Migration):
Expand Down
5 changes: 2 additions & 3 deletions src/makerspace/migrations/0006_equipment_last_modified.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='equipment',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-11-01 11:10

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,19 +14,19 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='article',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='event',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='timeplace',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 4.0.6 on 2022-09-12 19:51

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc
import django.utils.timezone


Expand All @@ -16,7 +15,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='eventticket',
name='active_last_modified',
field=models.DateTimeField(blank=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last changed to active/canceled'),
field=models.DateTimeField(blank=True, default=datetime.utcfromtimestamp(0), verbose_name='last changed to active/canceled'),
preserve_default=False,
),
migrations.AlterField(
Expand All @@ -27,7 +26,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='eventticket',
name='creation_date',
field=models.DateTimeField(auto_now_add=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='original registration date'),
field=models.DateTimeField(auto_now_add=True, default=datetime.utcfromtimestamp(0), verbose_name='original registration date'),
preserve_default=False,
),
]

0 comments on commit 07a3933

Please sign in to comment.