diff --git a/django/db/models/base.py b/django/db/models/base.py index 626591c0e2..3b09c73c8a 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -35,8 +35,7 @@ class ModelBase(type): model_module = sys.modules[new_class.__module__] - if not hasattr(new_class._meta, 'app_label') or \ - new_class._meta.app_label is None: + if getattr(new_class._meta, 'app_label', None) is None: # Figure out the app_label by looking one level up. # For 'django.contrib.sites.models', this would be 'sites'. new_class._meta.app_label = model_module.__name__.split('.')[-2]