From 0dbd34956dbd7ce4e2ad6d9947d3ceab8d723644 Mon Sep 17 00:00:00 2001 From: BorisBachere <146738197+BorisBachere@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:31:00 +0200 Subject: [PATCH] Update repo.py Check if slug exists in data. Without this check, import fail when SLUGS are not none in .env --- repo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repo.py b/repo.py index f52e0b0..2361d34 100644 --- a/repo.py +++ b/repo.py @@ -98,7 +98,10 @@ class DTLRepo: # Save file location to resolve any relative paths for images data['src'] = file - if slugs and True not in [True if s.casefold() in data['slug'].casefold() else False for s in slugs]: + match_any_given_slug_wildcard = any( + [s.lower() in data["slug"].lower() for s in slugs if "slug" in data] + ) + if not match_any_given_slug_wildcard: self.handle.verbose_log(f"Skipping {data['model']}") continue