Closed hofermo closed 5 months ago
Thanks for the report, I believe your analysis is correct.
@azmeuk any clue about how to fix this issue? Do we need to create a context when working from the command line? We should definitely add a test that calls the command line to detect this kind of regression.
Reproducible in local with ./ihatemoney/manage.py generate_password_hash
. I just submitted a patch that fixes this, indeed a context application was needed.
Strangely, there is already a test for this command, and it was not failing. I am not sure why though.
Ah :thinking: That might be pytest-flask inducing an application context for the whole testsuite, and thus provoking a false negative (or is it false positive? I am not sure which one this should be called :shrug:).
I did not understand why I could not reproduce the bug with ./ihatemoney/manage.py generate_password_hash
, but now the issue is solved in master.
My understanding that using @cli.command
instead of @click.command
probably injected the needed application context in generate_password_hash
.
I will try to reproduce a MRE to check that there is a problem with pytest-flask, and open a bug report there if needed.
Closing, this was fixed with c2fc33a8ca44fc6e867d84b77d1ca7c695879929 in the stable-6.1
branch (released as 6.1.2), and the bug no longer triggers in master due to the @click/@cli
change.
When using the latest Docker image, version 6.1.1, it is not possible to create a password, as the application context isn't created.
This could be the breaking change, but I am not too familiar with the project. https://github.com/spiral-project/ihatemoney/commit/857ca2d5b01c7722016a8bc1fd89324acbfcab55#diff-91addaa276f43da0d54547b88d095bed802e84332616f73e08e218679213842fR455
Here the console output when trying to run
docker run -it --rm --entrypoint ihatemoney ihatemoney/ihatemoney generate_password_hash
, like it is stated in the documentation:~The quick fix for now is to just use version 6.1.0 where the hashing still works.~