From 5d1407327acc9104ff96c18436322c767f651fe0 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Fri, 13 Oct 2023 14:16:42 -0400
Subject: [PATCH] fix: add default value to Note.tags

---
 program/migrations/0073_alter_note_tags.py | 2 +-
 program/models.py                          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/migrations/0073_alter_note_tags.py b/program/migrations/0073_alter_note_tags.py
index f8c8102d..fb17daec 100644
--- a/program/migrations/0073_alter_note_tags.py
+++ b/program/migrations/0073_alter_note_tags.py
@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
             old_name="tags",
         ),
         migrations.AddField(
-            field=models.JSONField(blank=True),
+            field=models.JSONField(blank=True, default=list),
             model_name="note",
             name="tags",
         ),
diff --git a/program/models.py b/program/models.py
index 9c52d84b..9080e4f3 100644
--- a/program/models.py
+++ b/program/models.py
@@ -447,7 +447,7 @@ class Note(models.Model):
     # TODO: this requires show in the model and an unique_together constraint. Do we need this?
     slug = models.SlugField(blank=True, max_length=32)
     summary = models.TextField(blank=True)
-    tags = models.JSONField(blank=True)
+    tags = models.JSONField(blank=True, default=list)
     timeslot = models.OneToOneField(TimeSlot, null=True, on_delete=models.SET_NULL, unique=True)
     title = models.CharField(max_length=128)
     updated_at = models.DateTimeField(auto_now=True, blank=True, null=True)
-- 
GitLab