Change 'Field hasn't specified on_delete action' to a warning rather than an error, as per #792

pull/811/head
Matt Westcott 2014-11-12 16:22:08 +00:00
rodzic 0e38ecea5b
commit 35b8bc2443
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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 field.rel.on_delete == models.CASCADE:
errors.append(
checks.Error(
checks.Warning(
"Field hasn't specified on_delete action",
hint="Set on_delete=models.SET_NULL and make sure the field is nullable.",
obj=field,
id='wagtailcore.E001',
id='wagtailcore.W001',
)
)