mirror of
https://github.com/netbox-community/Device-Type-Library-Import.git
synced 2024-11-28 10:33:13 +01:00
Update repo.py
Check if slug exists in data. Without this check, import fail when SLUGS are not none in .env
This commit is contained in:
parent
226210ad55
commit
0dbd34956d
5
repo.py
5
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user