kopia lustrzana https://github.com/wagtail/wagtail
Merge branch 'start-13' of https://github.com/kaedroho/wagtail
commit
a8d3aca007
|
@ -1,6 +1,10 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
1.3 (xx.xx.xxxx)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
1.2 (xx.xx.xxxx)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
==========================================
|
||||
Wagtail 1.3 release notes - IN DEVELOPMENT
|
||||
==========================================
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
|
||||
What's new
|
||||
==========
|
||||
|
||||
|
||||
Minor features
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Bug fixes
|
||||
~~~~~~~~~
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
======================
|
|
@ -4,6 +4,7 @@ Release notes
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
1.3
|
||||
1.2
|
||||
1.1
|
||||
1.0
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
class RemovedInWagtail13Warning(DeprecationWarning):
|
||||
class RemovedInWagtail14Warning(DeprecationWarning):
|
||||
pass
|
||||
|
||||
|
||||
removed_in_next_version_warning = RemovedInWagtail13Warning
|
||||
removed_in_next_version_warning = RemovedInWagtail14Warning
|
||||
|
||||
|
||||
class RemovedInWagtail14Warning(PendingDeprecationWarning):
|
||||
class RemovedInWagtail15Warning(PendingDeprecationWarning):
|
||||
pass
|
||||
|
|
|
@ -42,7 +42,7 @@ from wagtail.wagtailcore.signals import page_published, page_unpublished
|
|||
from wagtail.wagtailsearch import index
|
||||
from wagtail.wagtailsearch.backends import get_search_backend
|
||||
|
||||
from wagtail.utils.deprecation import RemovedInWagtail13Warning, RemovedInWagtail14Warning
|
||||
from wagtail.utils.deprecation import RemovedInWagtail14Warning
|
||||
|
||||
|
||||
logger = logging.getLogger('wagtail.core')
|
||||
|
@ -204,13 +204,7 @@ class PageBase(models.base.ModelBase):
|
|||
# All pages should be creatable unless explicitly set otherwise.
|
||||
# This attribute is not inheritable.
|
||||
if 'is_creatable' not in dct:
|
||||
if 'is_abstract' in dct:
|
||||
warnings.warn(
|
||||
"The is_abstract flag is deprecated - use is_creatable instead.",
|
||||
RemovedInWagtail13Warning)
|
||||
cls.is_creatable = not dct['is_abstract']
|
||||
else:
|
||||
cls.is_creatable = not cls._meta.abstract
|
||||
cls.is_creatable = not cls._meta.abstract
|
||||
|
||||
if cls.is_creatable:
|
||||
# register this type in the list of page content types
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import datetime
|
||||
import json
|
||||
import warnings
|
||||
|
||||
import pytz
|
||||
|
||||
|
@ -10,7 +9,6 @@ from django.http import HttpRequest, Http404
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
from django.utils.six import text_type
|
||||
|
||||
from wagtail.wagtailcore.models import Page, Site, PAGE_MODEL_CLASSES
|
||||
from wagtail.tests.testapp.models import (
|
||||
|
@ -841,22 +839,3 @@ class TestIsCreatable(TestCase):
|
|||
"""
|
||||
self.assertFalse(AbstractPage.is_creatable)
|
||||
self.assertNotIn(AbstractPage, PAGE_MODEL_CLASSES)
|
||||
|
||||
def test_is_abstract(self):
|
||||
"""
|
||||
is_abstract has been deprecated. Check that it still works, but issues
|
||||
a deprecation warning
|
||||
"""
|
||||
with warnings.catch_warnings(record=True) as ws:
|
||||
class IsAbstractPage(Page):
|
||||
is_abstract = True
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
self.assertEqual(len(ws), 1)
|
||||
warning = ws[0]
|
||||
self.assertIn("is_creatable", text_type(warning.message))
|
||||
|
||||
self.assertFalse(AbstractPage.is_creatable)
|
||||
self.assertNotIn(AbstractPage, PAGE_MODEL_CLASSES)
|
||||
|
|
Ładowanie…
Reference in New Issue