kopia lustrzana https://github.com/wagtail/wagtail
Change 'Field hasn't specified on_delete action' to a warning rather than an error, as per #792
rodzic
0e38ecea5b
commit
35b8bc2443
|
@ -385,11 +385,11 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed
|
||||||
if isinstance(field, models.ForeignKey) and field.name not in field_exceptions:
|
if isinstance(field, models.ForeignKey) and field.name not in field_exceptions:
|
||||||
if field.rel.on_delete == models.CASCADE:
|
if field.rel.on_delete == models.CASCADE:
|
||||||
errors.append(
|
errors.append(
|
||||||
checks.Error(
|
checks.Warning(
|
||||||
"Field hasn't specified on_delete action",
|
"Field hasn't specified on_delete action",
|
||||||
hint="Set on_delete=models.SET_NULL and make sure the field is nullable.",
|
hint="Set on_delete=models.SET_NULL and make sure the field is nullable.",
|
||||||
obj=field,
|
obj=field,
|
||||||
id='wagtailcore.E001',
|
id='wagtailcore.W001',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue