Column clean_name does not exist (Wagtail 2.10)

Viewed 212

I just upgraded from Wagtail 2.9.3 to 2.10 and discovered that my FormPages aren't working anymore due to a missing clean_name field. I read the documentation about this new change but I am at a complete loss as to how to fix it.

After upgrading, I tried running my local server but was told I needed to run migrations which I did. How can I add the clean_name column to my field? Do I just add the column to my FormField class below, like I normally would?

Below is the stack trace and relevant models.

ProgrammingError at /support-us/volunteer/
column core_formfield.clean_name does not exist
LINE 1: ...e_formfield"."id", "core_formfield"."sort_order", "core_form...
class FormField(AbstractFormField):
    page = ParentalKey(
        'FormPage',
        on_delete=models.CASCADE,
        related_name='form_fields',
    )

class FormPage(MetadataPageMixin, AbstractEmailForm):

    body = StreamField(BaseStreamBlock())
    confirmation_text = RichTextField(blank=True)

    content_panels = AbstractEmailForm.content_panels + [
        StreamFieldPanel('body'),
        InlinePanel('form_fields', label='Form Fields'),
        FieldPanel('confirmation_text'),
        MultiFieldPanel([
            FieldRowPanel([
                FieldPanel('from_address', classname="col6"),
                FieldPanel('to_address', classname="col6"),
            ]),
            FieldPanel("subject"),
        ], heading="Email Settings"),
    ]

    class Meta:
        verbose_name = 'Form Page'
        verbose_name_plural = 'Form Pages'

1 Answers

Running ./manage.py makemigrations and ./manage.py migrate after upgrading should be sufficient. No changes to your code are required - the new clean_name field is defined as part of AbstractFormField, so it doesn't need to be added to your own Formfield definition.

Related