Skip to content

Commit

Permalink
Merge pull request #215 from uktrade/LTD-4545-upgrade-django
Browse files Browse the repository at this point in the history
Upgrade to django 4.2
  • Loading branch information
Tllew authored Feb 6, 2024
2 parents 87bbbf7 + ce82e54 commit e6a3be4
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 55 deletions.
5 changes: 2 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ requests-mock = "*"
watchdog = {extras = ["watchmedo"], version = "*"}

[packages]
djangorestframework = "~=3.9"
djangorestframework = "~=3.14.0"
django-environ = "~=0.4"
django-model-utils = "~=4.0"
sentry-sdk = "~=1.17.0"
Expand All @@ -30,9 +30,8 @@ requests = "~=2.31"
unidecode = "~=1.2"
django-log-formatter-ecs = "==0.0.5"
gunicorn = "*"
django = "==3.2.23"
django = "~=4.2.8"
elastic-apm = "==6.7.2"
django-jsonfield = "==1.4"
msal = "~=1.22.0"
psycopg2-binary = "~=2.9.3"
setuptools = "~=65.5.1"
Expand Down
73 changes: 37 additions & 36 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool("DEBUG", default=False)

ALLOWED_HOSTS = "*"
ALLOWED_HOSTS = ["*"]

# Application definition

Expand Down
25 changes: 12 additions & 13 deletions mail/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import django.db.models.deletion
import django.utils.timezone
import jsonfield.fields
from django.db import migrations, models


Expand Down Expand Up @@ -85,20 +84,20 @@ class Migration(migrations.Migration):
name="UsageUpdate",
fields=[
("id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
("licence_ids", jsonfield.fields.JSONField(default=dict)),
("licence_ids", models.JSONField(default=dict)),
("spire_run_number", models.IntegerField()),
("hmrc_run_number", models.IntegerField()),
("has_lite_data", models.NullBooleanField(default=None)),
("has_spire_data", models.NullBooleanField(default=None)),
("lite_payload", jsonfield.fields.JSONField(default=dict)),
("has_lite_data", models.BooleanField(null=True)),
("has_spire_data", models.BooleanField(null=True)),
("lite_payload", models.JSONField(default=dict)),
("lite_sent_at", models.DateTimeField(blank=True, null=True)),
("lite_accepted_licences", jsonfield.fields.JSONField(default=dict)),
("lite_rejected_licences", jsonfield.fields.JSONField(default=dict)),
("spire_accepted_licences", jsonfield.fields.JSONField(default=dict)),
("spire_rejected_licences", jsonfield.fields.JSONField(default=dict)),
("lite_licences", jsonfield.fields.JSONField(default=dict)),
("spire_licences", jsonfield.fields.JSONField(default=dict)),
("lite_response", jsonfield.fields.JSONField(default=dict)),
("lite_accepted_licences", models.JSONField(default=dict)),
("lite_rejected_licences", models.JSONField(default=dict)),
("spire_accepted_licences", models.JSONField(default=dict)),
("spire_rejected_licences", models.JSONField(default=dict)),
("lite_licences", models.JSONField(default=dict)),
("spire_licences", models.JSONField(default=dict)),
("lite_response", models.JSONField(default=dict)),
("mail", models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to="mail.Mail")),
],
options={
Expand Down Expand Up @@ -134,7 +133,7 @@ class Migration(migrations.Migration):
choices=[("insert", "Insert"), ("cancel", "Cancel"), ("update", "Update")], max_length=6
),
),
("data", jsonfield.fields.JSONField(default=dict)),
("data", models.JSONField(default=dict)),
("received_at", models.DateTimeField(default=django.utils.timezone.now)),
("is_processed", models.BooleanField(default=False)),
("old_lite_id", models.UUIDField(null=True)),
Expand Down
22 changes: 22 additions & 0 deletions mail/migrations/0022_alter_licencedata_licence_payloads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.9 on 2024-01-04 14:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("mail", "0021_licencepayload_skip_process"),
]

operations = [
migrations.AlterField(
model_name="licencedata",
name="licence_payloads",
field=models.ManyToManyField(
help_text="LicencePayload records linked to this LicenceData instance",
related_name="+",
to="mail.licencepayload",
),
),
]
4 changes: 2 additions & 2 deletions mail/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class UsageData(models.Model):
mail = models.ForeignKey(Mail, on_delete=models.DO_NOTHING, null=False)
spire_run_number = models.IntegerField()
hmrc_run_number = models.IntegerField()
has_lite_data = models.NullBooleanField(default=None)
has_spire_data = models.NullBooleanField(default=None)
has_lite_data = models.BooleanField(null=True)
has_spire_data = models.BooleanField(null=True)
lite_payload = models.JSONField(default=dict)
lite_sent_at = models.DateTimeField(blank=True, null=True) # When update was sent to LITE API
lite_accepted_licences = models.JSONField(default=list)
Expand Down

0 comments on commit e6a3be4

Please sign in to comment.