Skip to content

Commit

Permalink
add footer to import
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Feb 1, 2024
1 parent 1fc4623 commit 91ed2fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions home/import_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def add_message_to_shadow_content_page_from_row(
next_prompt=row.next_prompt,
example_values=row.example_values,
buttons=buttons,
footer=row.footer,
)
)
if row.is_sms_message:
Expand Down Expand Up @@ -528,6 +529,7 @@ class ShadowWhatsappBlock:
buttons: list[dict[str, Any]] = field(default_factory=list)
example_values: list[str] = field(default_factory=list)
variation_messages: list["ShadowVariationBlock"] = field(default_factory=list)
footer: str = ""

@property
def wagtail_format(
Expand All @@ -539,6 +541,7 @@ def wagtail_format(
"example_values": self.example_values,
"buttons": self.buttons,
"variation_messages": [m.wagtail_format for m in self.variation_messages],
"footer": self.footer,
}


Expand Down Expand Up @@ -627,6 +630,7 @@ class ContentRow:
doc_link: str = ""
media_link: str = ""
related_pages: list[str] = field(default_factory=list)
footer: str = ""

@classmethod
def from_flat(cls, row: dict[str, str]) -> "ContentRow":
Expand All @@ -646,6 +650,7 @@ def from_flat(cls, row: dict[str, str]) -> "ContentRow":
related_pages=deserialise_list(row.pop("related_pages", "")),
example_values=deserialise_list(row.pop("example_values", "")),
buttons=json.loads(row.pop("buttons", "")) if row.get("buttons") else [],
footer=str(row.pop("footer")) if row.get("footer") else None,
**row,
)

Expand Down

0 comments on commit 91ed2fb

Please sign in to comment.