﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32863	Model.check() crashes with invalid app label and no explicit DEFAULT_AUTO_FIELD	Iuri de Silvio	Hasan Ramezani	"I found this issue in `django-cryptography` lib (https://github.com/georgemarshall/django-cryptography). They have a test with an invalid `app_label`, I'd expect model check to return `False`, but it crashes when `DEFAULT_AUTO_FIELD` is not defined, because `_meta.app_config=None` .

{{{
In [1]: from django.db import models
   ...: class Foo(models.Model):
   ...:     class Meta:
   ...:         app_label = 'bar'
   ...: 

In [2]: Foo.check()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-f17a07bccce5> in <module>
----> 1 Foo.check()

~django/db/models/base.py in check(cls, **kwargs)
   1291                 *cls._check_ordering(),
   1292                 *cls._check_constraints(databases),
-> 1293                 *cls._check_default_pk(),
   1294             ]
   1295 

~django/db/models/base.py in _check_default_pk(cls)
   1307             ) and
   1308             not settings.is_overridden('DEFAULT_AUTO_FIELD') and
-> 1309             not cls._meta.app_config._is_default_auto_field_overridden
   1310         ):
   1311             return [

AttributeError: 'NoneType' object has no attribute '_is_default_auto_field_overridden'
}}}"	Bug	closed	Database layer (models, ORM)	3.2	Release blocker	fixed			Ready for checkin	1	0	0	0	0	0
