Commit d96960b1 authored by Michal Čihař's avatar Michal Čihař

Create index only for languages which have translation

parent 6e20b37e
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
# #
from trans.management.commands import WeblateCommand from trans.management.commands import WeblateCommand
from lang.models import Language
from trans.search import ( from trans.search import (
update_index, create_source_index, create_target_index update_index, create_source_index, create_target_index
) )
...@@ -41,7 +42,7 @@ class Command(WeblateCommand): ...@@ -41,7 +42,7 @@ class Command(WeblateCommand):
# Optionally rebuild indices from scratch # Optionally rebuild indices from scratch
if options['clean']: if options['clean']:
create_source_index() create_source_index()
for lang in languages: for lang in Language.objects.have_translation():
create_target_index(lang=lang.code) create_target_index(lang=lang.code)
units = self.get_units(*args, **options) units = self.get_units(*args, **options)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment