Skip to content
Snippets Groups Projects
Verified Commit cfbb3618 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Raise KeyError if choices for a disallowed collection are requested

parent 0f0f74c2
No related branches found
No related tags found
1 merge request!6Resolve "Export django model choices for icons"
......@@ -41,6 +41,9 @@ def icon_choices(collection: str) -> list[tuple[str, str]]:
from .types import IconifyJSON
if not collection_allowed(collection):
raise KeyError("The collection %s is disallowed." % collection)
# Load icon set through Iconify types
collection_file = os.path.join(JSON_ROOT, "json", f"{collection}.json")
icon_set = IconifyJSON.from_file(collection_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment