From 9d809f2c3b8b6a6e5a5aa361e1c6c2b4bc9c000d Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 8 Feb 2006 23:57:07 +0000 Subject: [PATCH] magic-removal: Small logic simplification in django.db.models.ModelBase git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2293 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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]