﻿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
15321	Models._get_unique_checks() does not return grandparents' unique checks	jku	aron45	"Consider the following models:

{{{
#!python
class Project(models.Model):
    title = models.CharField(max_length=255)
    internal_id = models.CharField(max_length=255, unique=True)

class SubProject(Project):
    # ... fields of SubProject ...
    pass

class SubSubProject(SubProject):
    # ... fields of SubSubProject ...
    pass
}}}

Following code works as expected (b.full_clean() throws a ValidationError):

{{{
#!python
a = SubProject( title = 'A', internal_id = 1 )
a.save()
b = SubProject( title = 'B', internal_id = 1 )
b.full_clean() # Throws ValidationError
}}}

Following code does not work as expected (b.full_clean() does not throw an exception, b.save() throws an IntegrityError):

{{{
#!python
a = SubSubProject( title = 'A', internal_id = 2 )
a.save()
b = SubSubProject( title = 'B', internal_id = 2 )
b.full_clean() # Does not throw any exception!
b.save() # Throws IntegrityError, of course!
}}}
"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	models, unique checks	aron45	Ready for checkin	1	0	0	0	0	0
