Skip to content

Commit

Permalink
🐛 fix the type select
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefEZ committed Jan 5, 2024
1 parent c0e489a commit abef841
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions qalib/translators/xml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,9 @@ def _render_type_select(
Returns (ui.RoleSelect): The rendered role select.
"""
attributes = self._extract_elements(component)
select_type = type(select_base.__name__, (select_base,), {"callback": callback})

assert issubclass(select_type, (ui.UserSelect, ui.RoleSelect, ui.MentionableSelect))
attributes["callback"] = callback

select = create_type_select(select_type, **attributes)
return select
return create_type_select(select_base, **attributes)

def _render_text_input(self, component: ElementTree.Element, callback: (Optional[Callback])) -> ui.TextInput:
"""Renders a text input based on the template in the element, and formatted values given by the keywords.
Expand Down

0 comments on commit abef841

Please sign in to comment.