File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,9 @@ def get_categories() -> dict[str, list[dict]]:
249249@app .context_processor
250250def utility_processor ():
251251 def get_card_type (category , demo ):
252- if category == 'visualizations' or demo ['id' ].startswith ('viz.' ):
252+ # Add a check for the existence of 'id' and its type
253+ demo_id = demo .get ('id' )
254+ if category == 'visualizations' or (isinstance (demo_id , str ) and demo_id .startswith ('viz.' )):
253255 return 'visualization-card'
254256 if 'leetcode' in category :
255257 return 'leetcode-card'
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ <h3>No demos discovered</h3>
8585 data-category ="{{ category }} "
8686 data-id ="{{ d.id }} "
8787 data-status ="{{ get_demo_status(d) }} "
88- data-search-text ="{{ (d.title + ' ' + category + ' ' + d.id)|lower }} ">
88+ data-search-text ="{{ (d.title + ' ' + category + ' ' + d.id|string )|lower }} ">
8989
9090 <!-- Card Header -->
9191 < header class ="card-header ">
@@ -136,7 +136,7 @@ <h3 class="card-title">{{ d.title }}</h3>
136136
137137 <!-- Card Actions -->
138138 < footer class ="card-actions ">
139- {% if category == 'visualizations' or d.id.startswith('viz.') %}
139+ {% if category == 'visualizations' or ( d.id|string) .startswith('viz.') %}
140140 {% if d.id == 'viz.sorting' %}
141141 < a class ="btn-primary " href ="{{ url_for('viz_sorting') }} "> Launch</ a >
142142 {% elif d.id == 'viz.graph' %}
You can’t perform that action at this time.
0 commit comments