fix failing tests
This commit is contained in:
Родитель
953f8bbf2a
Коммит
69944ab486
|
@ -46,7 +46,7 @@
|
|||
{%- if api_version >= 1.5 -%}
|
||||
<previews>
|
||||
{%- for preview in addon.previews.all() -%}
|
||||
<preview primary="{{ preview.highlight }}">
|
||||
<preview primary="{{ preview.highlight|int }}">
|
||||
<full type="{{ preview.filetype }}">
|
||||
{{ preview.image_url|urlparams(src='api') }}
|
||||
</full>
|
||||
|
|
|
@ -5,6 +5,7 @@ from django.utils import translation
|
|||
import multidb
|
||||
|
||||
from translations.models import Translation
|
||||
from translations.fields import TranslatedField
|
||||
|
||||
isnull = """IF(!ISNULL({t1}.localized_string), {t1}.{col}, {t2}.{col})
|
||||
AS {name}_{col}"""
|
||||
|
@ -24,6 +25,10 @@ def build_query(model, connection):
|
|||
else:
|
||||
fallback = settings.LANGUAGE_CODE
|
||||
|
||||
if not hasattr(model._meta, 'translated_fields'):
|
||||
model._meta.translated_fields = [f for f in model._meta.fields
|
||||
if isinstance(f, TranslatedField)]
|
||||
|
||||
# Add the selects and joins for each translated field on the model.
|
||||
for field in model._meta.translated_fields:
|
||||
# Add the primary and (possibly) fallback locale parameters.
|
||||
|
|
Загрузка…
Ссылка в новой задаче