mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-09 22:04:48 +00:00
Merge pull request #446 from ezawadzki/issue-445
Check if 'descendants' list has values
This commit is contained in:
commit
8ec460b789
1 changed files with 4 additions and 3 deletions
|
|
@ -466,9 +466,10 @@ class Translator(object):
|
|||
else:
|
||||
descendants = [d.__name__ for d in self._registry.keys()
|
||||
if issubclass(d, model) and d != model]
|
||||
raise DescendantRegistered(
|
||||
'Model "%s" cannot be registered after its subclass'
|
||||
' "%s"' % (model.__name__, descendants[0]))
|
||||
if descendants:
|
||||
raise DescendantRegistered(
|
||||
'Model "%s" cannot be registered after its subclass'
|
||||
' "%s"' % (model.__name__, descendants[0]))
|
||||
|
||||
# Find inherited fields and create options instance for the model.
|
||||
opts = self._get_options_for_model(model, opts_class, **options)
|
||||
|
|
|
|||
Loading…
Reference in a new issue