fix
This commit is contained in:
parent
e677a1e6ae
commit
5149346772
|
|
@ -27,12 +27,12 @@ router = Router()
|
|||
async def t_callback_purchase_node_content(query: types.CallbackQuery, memory=None, user=None, db_session=None, chat_wrap=None, **extra):
|
||||
content_oid = int(query.data.split('_')[1])
|
||||
is_cancel_request = query.data.split('_')[2] == 'cancel' if len(query.data.split('_')) > 2 else False
|
||||
if not is_cancel_request:
|
||||
make_log("OwnedContent", f"{user} Try to purchase content: {content_oid}", level='info')
|
||||
content = db_session.query(StoredContent).filter_by(id=content_oid).first()
|
||||
if not content:
|
||||
return await query.answer(user.translated('error_contentNotFound'), show_alert=True)
|
||||
|
||||
if not is_cancel_request:
|
||||
make_log("OwnedContent", f"{user} Try to purchase content: {content_oid}", level='info')
|
||||
license_price = content.meta.get('license', {}).get('listen', {}).get('price')
|
||||
license_price_num = int(license_price)
|
||||
if license_price_num < 1:
|
||||
|
|
|
|||
Loading…
Reference in New Issue