Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/1763 - Update blocking_reports to use list instead of list() #1188

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from django.db import migrations, models
from django.contrib.postgres.fields import ArrayField


def update_blocking_reports_default(apps, schema_editor):
transaction = apps.get_model("transactions", "Transaction")
transaction._meta.get_field("blocking_reports").default = list


class Migration(migrations.Migration):
dependencies = [
("transactions", "0011_transaction_can_delete"),
]

operations = [
migrations.AlterField(
model_name="transaction",
name="blocking_reports",
field=ArrayField(
base_field=models.UUIDField(),
blank=False,
default=list,
size=None,
),
),
migrations.RunPython(update_blocking_reports_default),
]
2 changes: 1 addition & 1 deletion django-backend/fecfiler/transactions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def form_type(self, value):
)
# report ids of reports that have been submitted
# and in doing so have blocked this transaction from being deleted
blocking_reports = ArrayField(models.UUIDField(), blank=False, default=list())
blocking_reports = ArrayField(models.UUIDField(), blank=False, default=list)

objects = TransactionManager()

Expand Down