diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26524d117b..680adab4f3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,16 +9,17 @@ Changelog * Combine flake8 configurations (Sergey Fedoseev) * Improved diffing behavior for text fields (Aliosha Padovani) * Improve contrast of disabled inputs (Nick Smith) - * Added ``get_document_model_string`` function (Andrey Smirnov) + * Added `get_document_model_string` function (Andrey Smirnov) * Added support for Cloudflare API tokens for frontend cache invalidation (Tom Usher) * Added `ancestors` field to pages endpoint in admin API (Karl Hobley) + * Removed Django admin management of `Page` & `Site` models (Andreas Bernacca) * Fix: Rename documents listing column 'uploaded' to 'created' (LB (Ben Johnston)) * Fix: Submenu items longer then the page height are no longer broken by the submenu footer (Igor van Spengen) * Fix: Unbundle the l18n library as it was bundled to avoid installation errors which have been resolved (Matt Westcott) * Fix: Prevent error when comparing pages that reference a model with a custom primary key (Fidel Ramos) - * Fix: Moved ``get_document_model`` location so it can be imported when Models are not yet loaded (Andrey Smirnov) + * Fix: Moved `get_document_model` location so it can be imported when Models are not yet loaded (Andrey Smirnov) * Fix: Fixed incorrect HTML escaping of Jinja2 form templates for StructBlocks (Brady Moe) - * Fix: All templates with wagtailsettings and modeladmin now use ``block.super`` for ``extra_js`` & ``extra_css`` (Timothy Bautista) + * Fix: All templates with wagtailsettings and modeladmin now use `block.super` for `extra_js` & `extra_css` (Timothy Bautista) 2.7 LTS (06.11.2019) ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/releases/2.8.rst b/docs/releases/2.8.rst index c8eaa14af1..39f5b3b4b6 100644 --- a/docs/releases/2.8.rst +++ b/docs/releases/2.8.rst @@ -21,6 +21,7 @@ Other features * Added ``get_document_model_string`` function (Andrey Smirnov) * Added support for Cloudflare API tokens for frontend cache invalidation (Tom Usher) * Added ``ancestors`` field to pages endpoint in admin API (Karl Hobley) + * Removed Django admin management of ``Page`` & ``Site`` models (Andreas Bernacca) Bug fixes @@ -45,6 +46,23 @@ Django 2.0 is no longer supported as of this release; please upgrade to Django 2 ``wagtail.documents.models.get_document_model`` has moved -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``get_document_model`` function should now be imported from ``wagtail.documents`` rather than ``wagtail.documents.models``. See :ref:`custom_document_model`. + + +Removed ``Page`` and ``Site`` models from Django admin +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Django admin will no longer provide editing access to ``Page`` or ``Site`` models, if required these models can be registered within individual projects using `Django's ModelAdmin `_. + + +.. code-block:: python + + # my_app/admin.py + from django.contrib import admin + + from wagtail.core.models import Page, Site + + admin.site.register(Site) + admin.site.register(Page) diff --git a/wagtail/core/admin.py b/wagtail/core/admin.py deleted file mode 100644 index 0ddda283f3..0000000000 --- a/wagtail/core/admin.py +++ /dev/null @@ -1,25 +0,0 @@ -from django.contrib import admin -from django.contrib.auth.admin import GroupAdmin -from django.contrib.auth.models import Group - -from wagtail.core.models import GroupPagePermission, Page, Site - -admin.site.register(Site) -admin.site.register(Page) - - -# Extend GroupAdmin to include page permissions as an inline -class GroupPagePermissionInline(admin.TabularInline): - model = GroupPagePermission - raw_id_fields = ['page'] - verbose_name = 'page permission' - verbose_name_plural = 'page permissions' - - -class GroupAdminWithPagePermissions(GroupAdmin): - inlines = GroupAdmin.inlines + [GroupPagePermissionInline] - - -if admin.site.is_registered(Group): - admin.site.unregister(Group) -admin.site.register(Group, GroupAdminWithPagePermissions)