﻿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
21419	Model validation inspects models not present in INSTALLED_APPS	Josep Cugat	nobody	"I have uploaded a minimal project showing this issue here: https://github.com/jcugat/django-model-validation-bug

This project has two apps (`app_a` and `app_b`). `app_a` has two models: `Abstract_User_A` (a subclass of Django's `AbstractUser`), and `User_A` (a concrete subclass of `Abstract_User_A`). `app_b` has only one model: `User_B` (also a concrete subclass of `Abstract_User_A`).

In settings.py, only `app_b` is in INSTALLED_APPS, and the User model is swapped: `AUTH_USER_MODEL = 'app_b.User_B'`.

Executing `manage.py validate` shows the following errors:

{{{
CommandError: One or more models did not validate:
app_b.user_b: Accessor for m2m field 'groups' clashes with related m2m field 'Group.user_set'. Add a related_name argument to the definition for 'groups'.
app_b.user_b: Accessor for m2m field 'user_permissions' clashes with related m2m field 'Permission.user_set'. Add a related_name argument to the definition for 'user_permissions'.
}}}

The problem is that somehow the validate command is inspecting the model `User_A` althought it's not installed.

This works OK in Django 1.5.5, but fails in Django 1.6 and master."	Bug	closed	Uncategorized	1.6	Normal	fixed			Accepted	0	0	0	0	0	0
