spiral-project / ihatemoney

A simple shared budget manager web application
https://ihatemoney.org
Other
1.18k stars 267 forks source link

Can't open main page because of currencies #1239

Closed rakoo closed 1 year ago

rakoo commented 1 year ago

I seem to encounter the issue with currencies, mentioned in https://github.com/spiral-project/ihatemoney/issues/1229 and in https://github.com/spiral-project/ihatemoney/issues/1232, but I can't even open the home page:

ERROR [ihatemoney.run] Exception on / [GET]
Traceback (most recent call last):
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/flask_restful/__init__.py", line 298, in error_router
    return original_handler(e)
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/ihatemoney/web.py", line 276, in home
    project_form = get_project_form()
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/ihatemoney/web.py", line 271, in get_project_form
    return ProjectForm()
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/wtforms/form.py", line 208, in __call__
    return type.__call__(cls, *args, **kwargs)
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/ihatemoney/forms.py", line 153, in __init__
    for currency_name in self.currency_helper.get_currencies()
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/ihatemoney/currency_convertor.py", line 31, in get_currencies
    for rate in self.get_rates()
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/cachetools/__init__.py", line 520, in wrapper
    v = func(*args, **kwargs)
  File "/var/www/ihatemoney/venv/lib/python3.9/site-packages/ihatemoney/currency_convertor.py", line 24, in get_rates
    rates = requests.get(self.api_url).json()["rates"]
KeyError: 'rates'

Because of this I can't even see my current bills.

Version: 5.2.0~ynh3 (Running on yunohost)

almet commented 1 year ago

Hi, I suspect this is similar to https://github.com/spiral-project/ihatemoney/commit/9341dc292eed75a1deefac3dd1c9689eeccf6e91

An upgrade should make it work.

zorun commented 1 year ago

Apparently yunohost still has IHM 5.2.0

They should upgrade to 6.1.0 at least

The upcoming 6.1.1 will get more currency-related hotfixes, but if yunohost maintainers read this, don't wait for it!

dylanmorroll commented 12 months ago

Hey, so on this note, I can see the list of currencies again in the project settings, which is great! Thanks :)

Also, adding bills in the project's default currency is working again. However, adding bills in the non-default currency results in an error:

image

I'm not sure if this is being tracked somewhere else, but thought I would bring it up. Thanks for the great work :)

almet commented 12 months ago

Thanks for the feedback. This is tracked in https://github.com/spiral-project/ihatemoney/issues/1232