Skip to content

Commit ebe51a8

Browse files
committed
fix(resources): make cover_image field non-nullable
1 parent 94652b5 commit ebe51a8

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

apps/resources/migrations/0003_requestdemo.py renamed to apps/resources/migrations/0004_alter_casestudy_cover_image_requestdemo.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 5.2.9 on 2026-03-17 08:23
1+
# Generated by Django 5.2.9 on 2026-04-03 04:51
22

33
import django.db.models.deletion
44
from django.db import migrations, models
@@ -7,11 +7,17 @@
77
class Migration(migrations.Migration):
88

99
dependencies = [
10-
('resources', '0002_casestudy_link'),
10+
('resources', '0003_alter_casestudy_content_alter_casestudy_link'),
1111
('tool_picker', '0004_alter_checkboxoption_order_alter_question_order'),
1212
]
1313

1414
operations = [
15+
migrations.AlterField(
16+
model_name='casestudy',
17+
name='cover_image',
18+
field=models.ImageField(default='', upload_to='case_studies/', verbose_name='Case Study Cover Image'),
19+
preserve_default=False,
20+
),
1521
migrations.CreateModel(
1622
name='RequestDemo',
1723
fields=[

apps/resources/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class CaseStudy(UserResource):
3232
cover_image = models.ImageField(
3333
upload_to="case_studies/",
3434
verbose_name="Case Study Cover Image",
35-
null=True,
36-
blank=True,
3735
)
3836
tool = models.ForeignKey[Tool, Tool](
3937
Tool,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.9 on 2026-04-08 09:47
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('tool_picker', '0004_alter_checkboxoption_order_alter_question_order'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='tool',
15+
name='catalogs',
16+
field=models.ManyToManyField(help_text='After adding or updating a catalog, the related questions are automatically populated to this tool.', related_name='tool_catalogs', to='tool_picker.catalog'),
17+
),
18+
]

apps/tool_picker/models.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ class Tool(UserResource):
159159
catalogs = models.ManyToManyField(
160160
Catalog,
161161
related_name="tool_catalogs",
162+
help_text="After adding or updating a catalog, the related questions are automatically populated to this tool.",
162163
)
163164
name = models.CharField[str, str](max_length=200)
164165
tagline = models.CharField[str, str](max_length=300, blank=True)
@@ -186,7 +187,14 @@ def __str__(self):
186187
class OrdinalTypeEnum(models.IntegerChoices):
187188
"""Enum representing scale of ordinal type question."""
188189

189-
NOT_AVAILABLE = 100, ("n/a")
190+
"""
191+
Note: The enum labels are intentionally descriptive and user-friendly so they can be
192+
used directly in the frontend UI and remain consistent with design requirements.
193+
"""
194+
NOT_AVAILABLE = (
195+
100,
196+
("We don't know enough to answer at this time or don't want to include this when considering options"),
197+
)
190198
ONE = 1, ("One")
191199
TWO = 2, ("Two")
192200
THREE = 3, ("Three")

0 commit comments

Comments
 (0)