From 52a2fdb2bcf50ac4203d6fa17774100e4d83fbe2 Mon Sep 17 00:00:00 2001 From: Adalberto Vazquez Date: Wed, 3 Jul 2024 17:55:12 -0600 Subject: [PATCH] Feature: Delete YoutubeRegretsReporterExtensionPage (#12573) * Feature: Remove YoutubeRegretsReporterExtensionPage * Fix: Remove unused import * Feature: Migration files for YoutubeRegretsReporterExtensionPage model deletion --- .../factory/youtube_regrets_page.py | 40 ------------------- ...ete_youtuberegretsreporterextensionpage.py | 16 ++++++++ network-api/networkapi/wagtailpages/models.py | 1 - .../wagtailpages/pagemodels/campaigns.py | 1 - .../wagtailpages/pagemodels/youtube.py | 18 --------- .../youtube_regrets_reporter_extension.html | 19 --------- 6 files changed, 16 insertions(+), 79 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0143_delete_youtuberegretsreporterextensionpage.py delete mode 100644 network-api/networkapi/wagtailpages/templates/wagtailpages/pages/regrets-reporter-landing-page/youtube_regrets_reporter_extension.html diff --git a/network-api/networkapi/wagtailpages/factory/youtube_regrets_page.py b/network-api/networkapi/wagtailpages/factory/youtube_regrets_page.py index 7a2561f25f4..0b0f5cdf13c 100644 --- a/network-api/networkapi/wagtailpages/factory/youtube_regrets_page.py +++ b/network-api/networkapi/wagtailpages/factory/youtube_regrets_page.py @@ -7,11 +7,9 @@ YoutubeRegrets2021Page, YoutubeRegrets2022Page, YoutubeRegretsPage, - YoutubeRegretsReporterExtensionPage, YoutubeRegretsReporterPage, ) -from .bannered_campaign_page import BanneredCampaignPageFactory from .campaign_page import CampaignIndexPageFactory @@ -32,19 +30,6 @@ class Meta: regret_stories = Faker("streamfield", fields=["regret_story"] * 28) -class YoutubeRegretsReporterExtensionPageFactory(PageFactory): - class Meta: - model = YoutubeRegretsReporterExtensionPage - exclude = ( - "title_text", - "header_text", - "header", - ) - - title = "Regrets Reporter Extension" - slug = "regretsreporter" - - class YoutubeRegrets2021PageFactory(PageFactory): class Meta: model = YoutubeRegrets2021Page @@ -124,28 +109,3 @@ def generate(seed): YoutubeRegrets2021PageFactory.create(parent=youtube_regrets) YoutubeRegrets2022PageFactory.create(parent=youtube_regrets) reseed(seed) - - # Youtube Extension Landing page - # Checking for a bannered campaign page titled "Youtube Regrets", and then creating the landing page if - # it does not exist. - try: - youtube_bannered_campaign_page = WagtailPage.objects.child_of(home_page).get(title=title) - print("Youtube Regrets bannered campaign page exists") - # If extension landing page does not exist, create it. - if not WagtailPage.objects.child_of(youtube_bannered_campaign_page).type(YoutubeRegretsReporterExtensionPage): - print("Generating extension landing page") - YoutubeRegretsReporterExtensionPageFactory.create(parent=youtube_bannered_campaign_page) - - # If bannered "YouTube Regrets" campaign page does not exist, create it and the extension landing page. - except WagtailPage.DoesNotExist: - print("Generating a youtube bannered campaign page and extension landing page") - youtube_bannered_campaign_page = BanneredCampaignPageFactory.create( - parent=home_page, - title="YouTube Regrets", - slug="youtube", - show_in_menus=False, - live=True, - ) - YoutubeRegretsReporterExtensionPageFactory.create(parent=youtube_bannered_campaign_page) - - reseed(seed) diff --git a/network-api/networkapi/wagtailpages/migrations/0143_delete_youtuberegretsreporterextensionpage.py b/network-api/networkapi/wagtailpages/migrations/0143_delete_youtuberegretsreporterextensionpage.py new file mode 100644 index 00000000000..ebbb05b7e92 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0143_delete_youtuberegretsreporterextensionpage.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.11 on 2024-07-03 23:27 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("wagtailpages", "0142_alter_blogindexpage_callout_box"), + ] + + operations = [ + migrations.DeleteModel( + name="YoutubeRegretsReporterExtensionPage", + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index fc2d3751434..c41f6b6f88e 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -116,6 +116,5 @@ YoutubeRegrets2021Page, YoutubeRegrets2022Page, YoutubeRegretsPage, - YoutubeRegretsReporterExtensionPage, YoutubeRegretsReporterPage, ) diff --git a/network-api/networkapi/wagtailpages/pagemodels/campaigns.py b/network-api/networkapi/wagtailpages/pagemodels/campaigns.py index 69a3123f427..8cfc4714653 100644 --- a/network-api/networkapi/wagtailpages/pagemodels/campaigns.py +++ b/network-api/networkapi/wagtailpages/pagemodels/campaigns.py @@ -439,7 +439,6 @@ class BanneredCampaignPage(PrimaryPage): "PublicationPage", "OpportunityPage", "ArticlePage", - "YoutubeRegretsReporterExtensionPage", "YoutubeRegrets2021Page", "YoutubeRegrets2022Page", "YoutubeRegretsPage", diff --git a/network-api/networkapi/wagtailpages/pagemodels/youtube.py b/network-api/networkapi/wagtailpages/pagemodels/youtube.py index bdd707d2b7c..3904c7a0a3d 100644 --- a/network-api/networkapi/wagtailpages/pagemodels/youtube.py +++ b/network-api/networkapi/wagtailpages/pagemodels/youtube.py @@ -151,21 +151,3 @@ class YoutubeRegrets2022Page(BasePage): class Meta: verbose_name = "YouTube Regrets 2022 Page" verbose_name_plural = "YouTube Regrets 2022 Pages" - - -class YoutubeRegretsReporterExtensionPage(BasePage): - template = "wagtailpages/pages/regrets-reporter-landing-page/youtube_regrets_reporter_extension.html" - max_count = 1 - - translatable_fields = [ - # Promote tab fields - SynchronizedField("slug"), - TranslatableField("seo_title"), - SynchronizedField("show_in_menus"), - TranslatableField("search_description"), - SynchronizedField("search_image"), - # Content tab fields - TranslatableField("title"), - ] - - content_panels = Page.content_panels # Needed for wagtail-modeltranslation to work diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/pages/regrets-reporter-landing-page/youtube_regrets_reporter_extension.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/pages/regrets-reporter-landing-page/youtube_regrets_reporter_extension.html deleted file mode 100644 index 788a6813083..00000000000 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/pages/regrets-reporter-landing-page/youtube_regrets_reporter_extension.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "pages/base.html" %} -{% load static %} - -{% block body_id %}youtube-regrets-reporter-extension{% endblock %} - -{% block extended_head %} - - -{% endblock %} - -{% block content_wrapped %} -
- - {% include "./extension_hero.html" %} - - {% include "./extension_text_columns.html" %} -
- -{% endblock %}