Skip to content

Commit

Permalink
fix: Union parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazawazi committed Oct 22, 2023
1 parent 32da3f2 commit 780509b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions backend/funix/decorator/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ def get_type_widget_prop(
if function_arg_type_name in widget_type:
widget = widget_type[function_arg_type_name]
for single_widget_type in widget_type:
if function_annotation.__name__ == single_widget_type:
widget = widget_type[single_widget_type]
break
if hasattr(function_annotation, "__name__"):
if getattr(function_annotation, "__name__") == single_widget_type:
widget = widget_type[single_widget_type]
break
if not widget:
if function_annotation.__name__ in builtin_widgets:
widget = builtin_widgets[function_annotation.__name__]
if hasattr(function_annotation, "__name__"):
if getattr(function_annotation, "__name__") in builtin_widgets:
widget = builtin_widgets[getattr(function_annotation, "__name__")]
if widget and anal_result:
anal_result["widget"] = widget

Expand Down

0 comments on commit 780509b

Please sign in to comment.