Commit 45b5fc50 authored by Michal Čihař's avatar Michal Čihař

Do not try to index empty units

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent c7e5ee98
......@@ -182,6 +182,8 @@ def update_index_unit(unit, source=True):
# Should this happen in background?
if appsettings.OFFLOAD_INDEXING:
from weblate.trans.models.search import IndexUpdate
if not unit.target and not source:
return
try:
with transaction.atomic():
IndexUpdate.objects.create(
......
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