mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-05-24 06:43:49 +00:00
Do not check translated slugs on non-translated models
This commit is contained in:
parent
82d05f59f6
commit
6b0b24463d
1 changed files with 5 additions and 1 deletions
|
|
@ -503,7 +503,11 @@ def _validate_slugs(page):
|
|||
for model in allowed_sibblings:
|
||||
slug = getattr(page, current_slug, '') or ''
|
||||
if len(slug) and model is not Page:
|
||||
kwargs = {'{0}__{1}'.format(model._meta.model_name, current_slug): slug}
|
||||
if model in WagtailTranslator._patched_models:
|
||||
field_name = '{0}__{1}'.format(model._meta.model_name, current_slug)
|
||||
else:
|
||||
field_name = '{0}__slug'.format(model._meta.model_name)
|
||||
kwargs = {field_name: slug}
|
||||
query_list.append(Q(**kwargs))
|
||||
|
||||
if query_list and siblings.filter(reduce(operator.or_, query_list)).exists():
|
||||
|
|
|
|||
Loading…
Reference in a new issue