Browse Source

Fixing bad migrations caused by refactoring, and by django template rendering of project_template (#229)

Vince Salvino 5 years ago
parent
commit
bb87f127ea

+ 9 - 26
coderedcms/models/page_models.py

@@ -216,9 +216,7 @@ class CoderedPage(WagtailCacheMixin, Page, metaclass=CoderedPageMeta):
         on_delete=models.SET_NULL,
         related_name='+',
         verbose_name=_('Open Graph preview image'),
-        help_text=_(
-            "The image shown when linking to this page on social media. If blank, defaults to article cover image, or logo in Settings > Layout > Logo"  # noqa
-        )
+        help_text=_("The image shown when linking to this page on social media. If blank, defaults to article cover image, or logo in Settings > Layout > Logo"),  # noqa
     )
     struct_org_type = models.CharField(
         default='',
@@ -251,9 +249,7 @@ class CoderedPage(WagtailCacheMixin, Page, metaclass=CoderedPageMeta):
         on_delete=models.SET_NULL,
         related_name='+',
         verbose_name=_('Photo of Organization'),
-        help_text=_(
-            "A photo of the facility. This photo will be cropped to 1:1, 4:3, and 16:9 aspect ratios automatically."  # noqa
-        )
+        help_text=_('A photo of the facility. This photo will be cropped to 1:1, 4:3, and 16:9 aspect ratios automatically.'),  # noqa
     )
     struct_org_phone = models.CharField(
         blank=True,
@@ -289,9 +285,7 @@ class CoderedPage(WagtailCacheMixin, Page, metaclass=CoderedPageMeta):
         blank=True,
         max_length=255,
         verbose_name=_('Country'),
-        help_text=_(
-            "For example, USA. Two-letter ISO 3166-1 alpha-2 country code is also acceptible https://en.wikipedia.org/wiki/ISO_3166-1"  # noqa
-        )
+        help_text=_('For example, USA. Two-letter ISO 3166-1 alpha-2 country code is also acceptible https://en.wikipedia.org/wiki/ISO_3166-1'),  # noqa
     )
     struct_org_geo_lat = models.DecimalField(
         blank=True,
@@ -324,9 +318,7 @@ class CoderedPage(WagtailCacheMixin, Page, metaclass=CoderedPageMeta):
     struct_org_extra_json = models.TextField(
         blank=True,
         verbose_name=_('Additional Organization markup'),
-        help_text=_(
-            "Additional JSON-LD inserted into the Organization dictionary. Must be properties of https://schema.org/Organization or the selected organization type."  # noqa
-        )
+        help_text=_('Additional JSON-LD inserted into the Organization dictionary. Must be properties of https://schema.org/Organization or the selected organization type.'),  # noqa
     )
 
     ###############
@@ -337,9 +329,7 @@ class CoderedPage(WagtailCacheMixin, Page, metaclass=CoderedPageMeta):
         'coderedcms.ClassifierTerm',
         blank=True,
         verbose_name=_('Classifiers'),
-        help_text=_(
-            "Categorize and group pages together with classifiers. Used to organize and filter pages across the site."  # noqa
-        ),
+        help_text=_('Categorize and group pages together with classifiers. Used to organize and filter pages across the site.'),  # noqa
     )
     tags = ClusterTaggableManager(
         through=CoderedTag,
@@ -1040,17 +1030,13 @@ class CoderedFormMixin(models.Model):
         max_length=255,
         blank=True,
         verbose_name=_('Email form submissions to'),
-        help_text=_(
-            "Optional - email form submissions to this address. Separate multiple addresses by comma."  # noqa
-        )
+        help_text=_('Optional - email form submissions to this address. Separate multiple addresses by comma.'),  # noqa
     )
     reply_address = models.CharField(
         max_length=255,
         blank=True,
         verbose_name=_('Reply-to address'),
-        help_text=_(
-            "Optional - to reply to the submitter, specify the email field here. For example, if a form field above is labeled 'Your Email', enter: {{ your_email }}"  # noqa
-        )
+        help_text=_('Optional - to reply to the submitter, specify the email field here. For example, if a form field above is labeled "Your Email", enter: {{ your_email }}'),  # noqa
     )
     subject = models.CharField(
         max_length=255,
@@ -1713,8 +1699,7 @@ class CoderedLocationPage(CoderedWebPage):
     auto_update_latlng = models.BooleanField(
         default=True,
         verbose_name=_("Auto Update Latitude and Longitude"),
-        help_text=_(
-            "If checked, automatically update the latitude and longitude when the address is updated.")  # noqa
+        help_text=_("If checked, automatically update the latitude and longitude when the address is updated.")  # noqa
     )
     map_title = models.CharField(
         blank=True,
@@ -1858,9 +1843,7 @@ class CoderedLocationIndexPage(CoderedWebPage):
             MaxValueValidator(20),
             MinValueValidator(1),
         ],
-        help_text=_(
-            "Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings"  # noqa
-        )
+        help_text=_("Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings")  # noqa
     )
 
     layout_panels = CoderedWebPage.layout_panels + [

+ 2 - 5
coderedcms/models/snippet_models.py

@@ -38,9 +38,7 @@ class Carousel(ClusterableModel):
     show_controls = models.BooleanField(
         default=True,
         verbose_name=_('Show controls'),
-        help_text=_(
-            "Shows arrows on the left and right of the carousel to advance next or previous slides."  # noqa
-        ),
+        help_text=_('Shows arrows on the left and right of the carousel to advance next or previous slides.'),  # noqa
     )
     show_indicators = models.BooleanField(
         default=True,
@@ -388,8 +386,7 @@ class CoderedEmail(ClusterableModel):
         max_length=255,
         blank=True,
         verbose_name=_('From Address'),
-        help_text=_(
-            'For example: "sender@example.com" or "Sender Name <sender@example.com>" (without quotes).')  # noqa
+        help_text=_('For example: "sender@example.com" or "Sender Name <sender@example.com>" (without quotes).')  # noqa
     )
     reply_address = models.CharField(
         max_length=255,

+ 8 - 24
coderedcms/models/wagtailsettings_models.py

@@ -223,9 +223,7 @@ class AnalyticsSettings(BaseSetting):
     ga_track_button_clicks = models.BooleanField(
         default=False,
         verbose_name=_('Track button clicks'),
-        help_text=_(
-            "Track all button clicks using Google Analytics event tracking. Event tracking details can be specified in each button’s advanced settings options."  # noqa
-        ),
+        help_text=_('Track all button clicks using Google Analytics event tracking. Event tracking details can be specified in each button’s advanced settings options.'),  # noqa
     )
 
     panels = [
@@ -250,9 +248,7 @@ class ADASettings(BaseSetting):
     skip_navigation = models.BooleanField(
         default=False,
         verbose_name=_('Show skip navigation link'),
-        help_text=_(
-            "Shows a 'Skip Navigation' link above the navbar that takes you directly to the main content."  # noqa
-        ),
+        help_text=_('Shows a "Skip Navigation" link above the navbar that takes you directly to the main content.'),  # noqa
     )
 
     panels = [
@@ -277,9 +273,7 @@ class GeneralSettings(BaseSetting):
         blank=True,
         max_length=255,
         verbose_name=_('From email address'),
-        help_text=_(
-            "The default email address this site appears to send from. For example: 'sender@example.com' or 'Sender Name <sender@example.com>' (without quotes)"  # noqa
-        ),
+        help_text=_('The default email address this site appears to send from. For example: "sender@example.com" or "Sender Name <sender@example.com>" (without quotes)'),  # noqa
     )
     search_num_results = models.PositiveIntegerField(
         default=10,
@@ -317,30 +311,22 @@ class SeoSettings(BaseSetting):
     og_meta = models.BooleanField(
         default=True,
         verbose_name=_('Use OpenGraph Markup'),
-        help_text=_(
-            "Show an optimized preview when linking to this site on Facebook, Linkedin, Twitter, and others. See http://ogp.me/."  # noqa
-        ),
+        help_text=_('Show an optimized preview when linking to this site on Facebook, Linkedin, Twitter, and others. See http://ogp.me/.'),  # noqa
     )
     twitter_meta = models.BooleanField(
         default=True,
         verbose_name=_('Use Twitter Markup'),
-        help_text=_(
-            "Shows content as a 'card' when linking to this site on Twitter. See https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards."  # noqa
-        ),
+        help_text=_('Shows content as a "card" when linking to this site on Twitter. See https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards.'),  # noqa
     )
     struct_meta = models.BooleanField(
         default=True,
         verbose_name=_('Use Structured Data'),
-        help_text=_(
-            "Optimizes information about your organization for search engines. See https://schema.org/."  # noqa
-        ),
+        help_text=_('Optimizes information about your organization for search engines. See https://schema.org/.'),  # noqa
     )
     amp_pages = models.BooleanField(
         default=True,
         verbose_name=_('Use AMP Pages'),
-        help_text=_(
-            "Generates an alternate AMP version of Article pages that are preferred by search engines. See https://www.ampproject.org/"  # noqa
-        ),
+        help_text=_('Generates an alternate AMP version of Article pages that are preferred by search engines. See https://www.ampproject.org/'),  # noqa
     )
 
     panels = [
@@ -350,9 +336,7 @@ class SeoSettings(BaseSetting):
                 FieldPanel('twitter_meta'),
                 FieldPanel('struct_meta'),
                 FieldPanel('amp_pages'),
-                HelpPanel(content=_(
-                    "If these settings are enabled, the corresponding values in each page’s SEO tab are used."  # noqa
-                )),
+                HelpPanel(content=_('If these settings are enabled, the corresponding values in each page’s SEO tab are used.')),  # noqa
             ],
             heading=_('Search Engine Optimization')
         )

+ 11 - 3
coderedcms/project_template/basic/website/migrations/0001_initial.py

@@ -1,4 +1,11 @@
-# Generated by Django 2.2.2 on 2019-06-19 15:13
+{% comment %}
+ """
+ IMPORTANT!!! This file must be wrapped in `verbatim` tags to avoid accidentally rendering
+ any labels/help text that might be interpreted as a django template tag (i.e. {{ }} )
+ """
+{% endcomment %}
+{% verbatim %}
+# Generated by Django 2.2.4 on 2019-08-03 16:14
 
 import coderedcms.blocks.base_blocks
 import coderedcms.blocks.html_blocks
@@ -108,8 +115,8 @@ class Migration(migrations.Migration):
                 ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='confirmation_emails', to='website.FormPage')),
             ],
             options={
-                'abstract': False,
                 'verbose_name': 'CodeRed Email',
+                'abstract': False,
             },
         ),
         migrations.CreateModel(
@@ -123,9 +130,10 @@ class Migration(migrations.Migration):
                 ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Author')),
             ],
             options={
-                'ordering': ['-first_published_at'],
                 'verbose_name': 'Article',
+                'ordering': ['-first_published_at'],
             },
             bases=('coderedcms.coderedpage',),
         ),
     ]
+{% endverbatim %}

File diff suppressed because it is too large
+ 9 - 6
coderedcms/project_template/sass/website/migrations/0001_initial.py


Some files were not shown because too many files changed in this diff