From 58629ea630edd549616ae48044b8d170a7d78eb1 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Thu, 18 Jan 2018 10:03:24 +0000 Subject: [PATCH] Update the default on the category to be the empty json dict --- .../public/projects/migrations/0004_projectpage_categories.py | 3 +-- opentech/public/projects/models.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opentech/public/projects/migrations/0004_projectpage_categories.py b/opentech/public/projects/migrations/0004_projectpage_categories.py index 39b935e45..efb106a02 100644 --- a/opentech/public/projects/migrations/0004_projectpage_categories.py +++ b/opentech/public/projects/migrations/0004_projectpage_categories.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.8 on 2018-01-17 22:22 +# Generated by Django 1.11.8 on 2018-01-18 10:03 from __future__ import unicode_literals from django.db import migrations, models @@ -16,6 +16,5 @@ class Migration(migrations.Migration): model_name='projectpage', name='categories', field=models.TextField(default='{}'), - preserve_default=False, ), ] diff --git a/opentech/public/projects/models.py b/opentech/public/projects/models.py index 5c16fe01f..52e3f21a2 100644 --- a/opentech/public/projects/models.py +++ b/opentech/public/projects/models.py @@ -109,7 +109,7 @@ class ProjectPage(FundingMixin, BasePage): status = models.CharField(choices=STATUSES, max_length=25, default=STATUSES[0][0]) body = StreamField(StoryBlock()) - categories = models.TextField() + categories = models.TextField(default="{}") search_fields = BasePage.search_fields + [ index.SearchField('introduction'), @@ -131,6 +131,7 @@ class ProjectPage(FundingMixin, BasePage): options = [int(id) for options in categories.values() for id in options] return Option.objects.select_related().filter(id__in=options).order_by('category') + class ProjectIndexPage(BasePage): subpage_types = ['ProjectPage'] parent_page_types = ['home.Homepage'] -- GitLab