Skip to content

Commit 5e383bb

Browse files
committed
Prevent empty title for push news
1 parent a9d9dff commit 5e383bb

4 files changed

Lines changed: 24 additions & 21 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 4.2.16 on 2026-03-18 14:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("cms", "0150_remove_user_page_tree_tutorial_seen_and_more"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="pushnotificationtranslation",
14+
name="title",
15+
field=models.CharField(max_length=250, verbose_name="title"),
16+
),
17+
]

integreat_cms/cms/models/push_notifications/push_notification_translation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PushNotificationTranslation(AbstractBaseModel):
2525
Data model representing a push notification translation
2626
"""
2727

28-
title = models.CharField(max_length=250, blank=True, verbose_name=_("title"))
28+
title = models.CharField(max_length=250, verbose_name=_("title"))
2929
text = models.TextField(
3030
max_length=500,
3131
blank=True,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
en: Make title field mandatory for push news
2+
de: Mache Titelfeld für Push-Nachrichten obligatorisch

tests/cms/views/view_config.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,18 +1549,8 @@
15491549
"edit_push_notification",
15501550
[*PRIV_STAFF_ROLES, MANAGEMENT],
15511551
{
1552-
"translations-TOTAL_FORMS": 2,
1553-
"translations-INITIAL_FORMS": 2,
1554-
"translations-MIN_NUM_FORMS": 2,
1555-
"translations-MAX_NUM_FORMS": 9,
1556-
"translations-0-id": 1,
1557-
"translations-0-language": 1,
1558-
"translations-0-title": "Test update a sent news",
1559-
"translations-0-text": "New scheduled content",
1560-
"translations-1-id": 2,
1561-
"translations-1-language": 2,
1562-
"translations-1-title": "Test EN",
1563-
"translations-1-text": "Test EN content",
1552+
"title": "Test EN",
1553+
"text": "Test EN content",
15641554
"regions": [1],
15651555
"channel": "news",
15661556
"mode": "ONLY_AVAILABLE",
@@ -1589,14 +1579,8 @@
15891579
"edit_push_notification",
15901580
PRIV_STAFF_ROLES,
15911581
{
1592-
"translations-TOTAL_FORMS": 1,
1593-
"translations-INITIAL_FORMS": 1,
1594-
"translations-MIN_NUM_FORMS": 1,
1595-
"translations-MAX_NUM_FORMS": 9,
1596-
"translations-0-id": 7,
1597-
"translations-0-language": 1,
1598-
"translations-0-title": "Test editing push notification of other region",
1599-
"translations-0-text": "New template content",
1582+
"title": "Test editing push notification of other region",
1583+
"text": "New template content",
16001584
"regions": [2],
16011585
"channel": "news",
16021586
"mode": "ONLY_AVAILABLE",

0 commit comments

Comments
 (0)