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

'Localization' object is not subscriptable #83

Closed
mastersuv opened this issue Nov 28, 2020 · 1 comment · Fixed by #84
Closed

'Localization' object is not subscriptable #83

mastersuv opened this issue Nov 28, 2020 · 1 comment · Fixed by #84

Comments

@mastersuv
Copy link
Contributor

Problematic line:

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

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
Copy link
Owner

@mastersuv Yes, that was a typo 😅

Can you please submit it as a PR?

@mastersuv mastersuv mentioned this issue Nov 28, 2020
@Steffo99 Steffo99 linked a pull request Nov 28, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants