Skip to content

Commit

Permalink
check footer and list item max characters when importing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Feb 14, 2024
1 parent 85bb89c commit 015fce5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions home/import_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,10 @@ def create_shadow_content_page_from_row(
)

if len(row.footer) > 60:
raise ImportException(
f"footer too long: {row.footer}", row.page_id
)
raise ImportException(f"footer too long: {row.footer}", row.page_id)

if len(row.list_items) > 24:
raise ImportException(
f"list_items too long: {row.list_items}", row.page_id
)
raise ImportException(f"list_items too long: {row.list_items}", row.page_id)

self.shadow_pages[(row.slug, locale)] = page

Expand Down Expand Up @@ -341,7 +337,6 @@ def add_message_to_shadow_content_page_from_row(
list_items=row.list_items,
)
)

if row.is_sms_message:
page.enable_sms = True
page.sms_body.append(ShadowSMSBlock(message=row.sms_body))
Expand Down
1 change: 0 additions & 1 deletion home/tests/test_content_import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import pytest
from django.core import serializers # type: ignore
from django.core.exceptions import ValidationError # type: ignore
from django.core.files.images import ImageFile # type: ignore
from openpyxl import load_workbook
from pytest_django.fixtures import SettingsWrapper
Expand Down

0 comments on commit 015fce5

Please sign in to comment.