From 8226b8c9576107c281d15040b17fa696cdaf87c6 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 26 Aug 2008 23:06:30 +0000 Subject: [PATCH] Fixed #8569 -- Ensure that apps are correctly set up before introspecting them in admin validation. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8605 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/validation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/django/contrib/admin/validation.py b/django/contrib/admin/validation.py index 4f8e1fe1cc..15135af899 100644 --- a/django/contrib/admin/validation.py +++ b/django/contrib/admin/validation.py @@ -17,6 +17,10 @@ def validate(cls, model): classmethod in the end if it is provided in cls. The signature of the custom validation classmethod should be: def validate(cls, model). """ + # Before we can introspect models, they need to be fully loaded so that + # inter-relations are set up correctly. We force that here. + models.get_apps() + opts = model._meta validate_base(cls, model)