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

Unable to add any new bills due to lack of default currency (6.1.0) #1229

Closed
lbeltrame opened this issue Sep 22, 2023 · 9 comments
Closed

Unable to add any new bills due to lack of default currency (6.1.0) #1229

lbeltrame opened this issue Sep 22, 2023 · 9 comments
Labels

Comments

@lbeltrame
Copy link

As the subject says, it is impossible to add new bills because the form prevents submitting, because the currency field is empty. This doesn't work via API as well because the API returns that currency is a required field.

There was an issue opened a couple of years ago, but it was closed (and it doesn't tell whether the issue was fixed or not).

Setup:

  • ihatemoney 6.1.0
  • Running via virtualenv (Python 3.11)
  • Database backend: Postgres
  • Application ran through uwsgi proxied to nginx

Checked database migrations and everything should be fine.

I couldn't extract meaningful information via logs, but I haven't raised the debug level yet.

@lbeltrame
Copy link
Author

lbeltrame commented Sep 22, 2023

EDIT: The reason is that originally a currency was set, many years ago. It remained set, but since the service used by this project is no longer available, I guess that broke things.

Setting manually to "No currency" allowed creation of new bills again. However I'm not going to close this, as this is still a bug.

@zorun
Copy link
Collaborator

zorun commented Sep 22, 2023

You mean that the project was created with a currency that no longer exists?

Can you look in the database to see what is the exact value of the currency for your project?

@zorun zorun added the bug label Sep 22, 2023
@zorun
Copy link
Collaborator

zorun commented Sep 22, 2023

That would be: SELECT id, name, default_currency FROM project;

The code around currencies is fragile, I would not be surprised if there are loopholes. Let's figure out the issue and add a testcase.

@almet
Copy link
Member

almet commented Sep 22, 2023

Interesting, thanks.

the service used by this project is no longer available

I was not even aware of this, and it's clearly something we should fix. Relying on external services is indeed a bad idea in the first place. We might want to completely change the way we're dealing with external currencies. I know that for instance in cospend they let you specify the conversion rate.

@UndeRus
Copy link

UndeRus commented Sep 29, 2023

I have same problem, now project is unusable, I can't add any transactions

Now ihatemoney calls this API https://api.exchangerate.host/latest?base=USD which need api key to use, we need to predefine currencies to make it work without external api calls

@Arvil
Copy link

Arvil commented Oct 1, 2023

I have encountered the same issue on ihatemoney.org, can confirm @lbeltrame's quick fix works there too

@zorun
Copy link
Collaborator

zorun commented Oct 1, 2023

As a quick fix, we can probably hard-code the list of currencies. This should allow adding bills in the same currency as the project currency. It seems to be the use-case of @lbeltrame and @Arvil here, since we prevent converting a project to "no currency" as soon as there are bills in different currencies.

The longer-term fate of the currency feature is discussed here: #1232

@shahram7
Copy link

shahram7 commented Oct 3, 2023

I have the same problem. I am not able to post a new note in the money buster app and in the server.
I am not able to select a currency in ihatemoney server because there is none available.
I am using mariadb and the latest docker image. (I've redeployed)

@zorun
Copy link
Collaborator

zorun commented Oct 4, 2023

Workaround added in #1240, and released as 6.1.1

@zorun zorun closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants