Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-iconify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
django-iconify
Commits
cfbb3618
Verified
Commit
cfbb3618
authored
2 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Raise KeyError if choices for a disallowed collection are requested
parent
0f0f74c2
No related branches found
No related tags found
1 merge request
!6
Resolve "Export django model choices for icons"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dj_iconify/util.py
+3
-0
3 additions, 0 deletions
dj_iconify/util.py
with
3 additions
and
0 deletions
dj_iconify/util.py
+
3
−
0
View file @
cfbb3618
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment