Skip to content

Commit

Permalink
Skip models that aren't in the configurations.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaverde committed Mar 10, 2017
1 parent 025dd7e commit eb5cca4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lektor_tipue_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ def on_before_build_all(self, builder, **extra):
def on_before_build(self, source, prog, **extra):
if isinstance(source, Page):

try:
if source.datamodel.id in self.models:
model = self.models[source.datamodel.id]
except Exception:
return
item = {key: source[field] for key,field in model.items()}
item['url'] = source.url_path

self.tipue_search[source.alt].append(item)
item = {key: source[field] for key, field in model.items()}
item['url'] = source.url_path

self.tipue_search[source.alt].append(item)

@check_enabled
def on_after_build_all(self, builder, **extra):
Expand Down

0 comments on commit eb5cca4

Please sign in to comment.