Steffo99 / greed

Customizable, multilanguage Telegram shop bot with Payments support
GNU Affero General Public License v3.0
540 stars 263 forks source link

'Localization' object is not subscriptable #83

Closed mastersuv closed 3 years ago

mastersuv commented 3 years ago

Problematic line: https://github.com/Steffo99/greed/blob/69dfbc15c0ffc6cdc0b8f5f151034a20bcfc9a14/database.py#L193

Hi there, I've been testing greed. Great project by the way. There is a problem with that line when a Manager tries to retreive the Transactions list and there is a refund for a customer. It causes the program to crash.

Error: Exception in <Worker 763512861>: 'Localization' object is not subscriptable File "/home/telegram/greed/database.py", line 193, in text string += f" | {w.loc['emoji_refunded']}" TypeError: 'Localization' object is not subscriptable

Original line string += f" | {w.loc['emoji_refunded']}"

I changed it to string += f" | {w.loc.get('emoji_refunded')}"

and apparently fixed the problem. I'm not a python developer, so I'm not sure if this is the right way to fix the problem.

Steffo99 commented 3 years ago

@mastersuv Yes, that was a typo 😅

Can you please submit it as a PR?