0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Use RemovedInWagtail113Warning for generic view 'instance' deprecations

This commit is contained in:
Matt Westcott 2017-06-16 11:30:46 +01:00
parent 844cb7746c
commit fe6b2f9f89

View File

@ -10,6 +10,7 @@ from django.views.generic.base import TemplateResponseMixin
from django.views.generic.edit import BaseCreateView, BaseDeleteView, BaseUpdateView
from django.views.generic.list import BaseListView
from wagtail.utils.deprecation import RemovedInWagtail113Warning
from wagtail.wagtailadmin import messages
from wagtail.wagtailadmin.utils import permission_denied
@ -140,7 +141,7 @@ class EditView(PermissionCheckedMixin, TemplateResponseMixin, BaseUpdateView):
def instance(self):
warnings.warn(
"instance attribute is deprecated, please use object instead",
category=DeprecationWarning
category=RemovedInWagtail113Warning
)
return self.object
@ -148,7 +149,7 @@ class EditView(PermissionCheckedMixin, TemplateResponseMixin, BaseUpdateView):
def instance(self, instance):
warnings.warn(
"instance attribute is deprecated, please use object instead",
category=DeprecationWarning
category=RemovedInWagtail113Warning
)
self.object = instance