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
This commit is contained in:
Malcolm Tredinnick 2008-08-26 23:06:30 +00:00
parent 255bf69e09
commit 8226b8c957
1 changed files with 4 additions and 0 deletions

View File

@ -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)