Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add support init fields from parent object in KeyboardButton #344

Merged
merged 2 commits into from May 31, 2020
Merged

fix: add support init fields from parent object in KeyboardButton #344

merged 2 commits into from May 31, 2020

Conversation

Birdi7
Copy link
Contributor

@Birdi7 Birdi7 commented May 30, 2020

Description

Fixes #343

The KeyboardButton object couldn't be deserialized because of no support of conf parameter(which is inherited from TelegramObject) in __init__ method

Code snippet which produces the error:

from aiogram.types import ReplyKeyboardMarkup, KeyboardButton

markup = ReplyKeyboardMarkup(row_width=4, resize_keyboard=True)
markup.add(KeyboardButton('something here'))
dict_kb = markup.to_python()
assert ReplyKeyboardMarkup.to_object(dict_kb) == markup

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I ran code snippet, which I included above. In addition, I added several unit tests to verify this behavior.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Birdi7 Birdi7 requested a review from JrooTJunior May 30, 2020 20:30
@JrooTJunior JrooTJunior merged commit 7076711 into aiogram:dev-2.x May 31, 2020
@evgfilim1 evgfilim1 added the bug Something is wrong with the framework label Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong with the framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReplyKeyboardMarkup: __init__() got an unexpected keyword argument 'conf'
3 participants