feat: awaitable entity representations
This commit is contained in:
@@ -25,13 +25,23 @@ async def show_editor(message: Message | CallbackQuery, **kwargs):
|
||||
value_type = field_descriptor.type_base
|
||||
|
||||
if field_descriptor.edit_prompt:
|
||||
edit_prompt = get_callable_str(
|
||||
field_descriptor.edit_prompt, field_descriptor, None, current_value
|
||||
edit_prompt = await get_callable_str(
|
||||
field_descriptor.edit_prompt,
|
||||
field_descriptor,
|
||||
callback_data
|
||||
if callback_data.context == CommandContext.COMMAND_FORM
|
||||
else None,
|
||||
current_value,
|
||||
)
|
||||
else:
|
||||
if field_descriptor.caption:
|
||||
caption_str = get_callable_str(
|
||||
field_descriptor.caption, field_descriptor, None, current_value
|
||||
caption_str = await get_callable_str(
|
||||
field_descriptor.caption,
|
||||
field_descriptor,
|
||||
callback_data
|
||||
if callback_data.context == CommandContext.COMMAND_FORM
|
||||
else None,
|
||||
current_value,
|
||||
)
|
||||
else:
|
||||
caption_str = field_descriptor.name
|
||||
@@ -42,7 +52,7 @@ async def show_editor(message: Message | CallbackQuery, **kwargs):
|
||||
)
|
||||
).format(
|
||||
name=caption_str,
|
||||
value=get_value_repr(current_value, field_descriptor, user.lang),
|
||||
value=await get_value_repr(current_value, field_descriptor, user.lang),
|
||||
)
|
||||
else:
|
||||
edit_prompt = (
|
||||
|
||||
Reference in New Issue
Block a user