Projet

Général

Profil

0001-misc-remove-external-links-from-search-index-when-re.patch

Frédéric Péters, 19 novembre 2018 20:33

Télécharger (1,33 ko)

Voir les différences:

Subject: [PATCH] misc: remove external links from search index when --remove
 is given (#28160)

 combo/apps/search/management/commands/update_index.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
combo/apps/search/management/commands/update_index.py
35 35
            # do not index site if there's no matching search cell
36 36
            return
37 37
        if not options.get('skip_external_links_collection', False):
38
            self.collect_external_links()
38
            self.collect_external_links(options)
39 39
        return super(Command, self).handle(**options)
40 40

  
41
    def collect_external_links(self):
41
    def collect_external_links(self, options):
42 42
        start_time = now()
43 43

  
44
        if options.get('remove'):
45
            ExternalLinkSearchItem.objects.all().delete()
46

  
44 47
        # assemble external links data
45 48
        links = {}
46 49
        for page in Page.objects.all():
47
-