coderedcorp/coderedcms

Deleting the included root page causes crash

weholt opened this issue · 2 comments

Describe the bug

If I try to delete the root page included after the base project has been created, I get a crash

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a new project using coderedcms start project_name
  2. Click delete on the only page available in the admin
  3. See error

Expected behavior

I want to be able to add a basic web page with some content as my root page, like the included WebPage.

Additional context

Exception details:


RuntimeError at /admin/pages/1/
Site-specific settings cannot be identified because `request` is not available in the context and `use_default_site` is False.
1	{% extends "wagtailadmin/base.html" %}
2	{% load wagtailimages_tags wagtailsettings_tags %}
3	
4	{% block furniture %}
5	    {% include "coderedcms/includes/crx_banner.html" %}
6	    {{ block.super }}
7	{% endblock %}
8	
9	{# NOTE: this must be on a single line, otherwise Django templates will create
10	  whitespace, and wagtail will think the whitespace is the custom logo! #}
11	{% block branding_logo %}{% if settings.coderedcms.LayoutSettings.logo %}<div class="crx-logo-container {{settings.coderedcms.LayoutSettings.navbar_color_scheme}}">{% image settings.coderedcms.LayoutSettings.logo original format-webp as logo_image %}<img src="{{ logo_image.url }}" class="crx-logo-custom" alt="Dashboard"></div>{% endif %}{% endblock %}

Wagtail must have a Root Page, and a Default Site, in order to function properly. I would recommend creating a new Root Page, then setting it as the default for your site, before deleting the existing Root Page. Does that work?

I didn't connect the new root page to a default site. That was the missing piece. Connecting my new root page to the default site, then deleting the former root page fixed the problem. Thanks :-)