Skip to content

Commit 5c8470e

Browse files
nmlorgtsnoam
authored andcommitted
Store bot in PreCheckoutQuery (python-telegram-bot#953)
Fixes python-telegram-bot#937
1 parent 3d4e050 commit 5c8470e

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The following wonderful people contributed directly or indirectly to this projec
2222
- `bimmlerd <https://github.com/bimmlerd>`_
2323
- `d-qoi <https://github.com/d-qoi>`_
2424
- `daimajia <https://github.com/daimajia>`_
25+
- `Daniel Reed <https://github.com/nmlorg>`_
2526
- `Eli Gao <https://github.com/eligao>`_
2627
- `ErgoZ Riftbit Vaper <https://github.com/ergoz>`_
2728
- `Eugene Lisitsky <https://github.com/lisitsky>`_

telegram/payment/precheckoutquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def de_json(cls, data, bot):
8787
data['from_user'] = User.de_json(data.pop('from'), bot)
8888
data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot)
8989

90-
return cls(**data)
90+
return cls(bot=bot, **data)
9191

9292
def to_dict(self):
9393
data = super(PreCheckoutQuery, self).to_dict()

tests/test_precheckoutquery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def test_de_json(self, bot):
5555
}
5656
pre_checkout_query = PreCheckoutQuery.de_json(json_dict, bot)
5757

58+
assert pre_checkout_query.bot is bot
5859
assert pre_checkout_query.id == self.id
5960
assert pre_checkout_query.invoice_payload == self.invoice_payload
6061
assert pre_checkout_query.shipping_option_id == self.shipping_option_id

0 commit comments

Comments
 (0)