Skip to content

Commit ae2e2cb

Browse files
author
Rob Hudson
committed
Update search indexing to bypass unlisted add-ons
1 parent cc7139d commit ae2e2cb

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

apps/addons/cron.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ def reindex_addons(index=None, addon_type=None):
454454
ids = (Addon.objects.values_list('id', flat=True)
455455
.filter(_current_version__isnull=False,
456456
status__in=amo.VALID_STATUSES,
457+
is_listed=True,
457458
disabled_by_user=False))
458459
if addon_type:
459460
ids = ids.filter(type=addon_type)

apps/addons/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,8 @@ def version_changed(sender, **kw):
15781578
def update_search_index(sender, instance, **kw):
15791579
from . import tasks
15801580
if not kw.get('raw'):
1581-
tasks.index_addons.delay([instance.id])
1581+
if not instance.disabled_by_user and instance.is_listed:
1582+
tasks.index_addons.delay([instance.id])
15821583

15831584

15841585
@Addon.on_change

0 commit comments

Comments
 (0)