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
Import previously exported json data #518
Conversation
This is really appalling, do you mind adding a test for the upload_form? |
I can do that. |
I meant adding a test to make sure that importing a given json will create the project with the expected members and bills. |
I added a test as requested and also modified some of what I had done before. I realized that it was possible to search for a user that had been deactivated. At first, I considered that they were two different people |
Is there anything else I can do? |
Co-Authored-By: Rémy HUBSCHER <hubscher.remy@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that using json.dump
instead of json.dumps
is really worthwhile. We are talking about importing projects with unknown sizes, so let's not hammer the memory twice.
I suggested some changes to tests. They are all passing on my installation.
Fix spiral-project#417 * New tab upload * Extract data from JSON * Add users * Black format * Try to add bill * Import bills * Add french translation msg * Black reformat missing * Deactivated users are supported * Test import * Remove temp file in upload_json() * Incomplete tests * tests import * Update ihatemoney/translations/fr/LC_MESSAGES/messages.po Co-Authored-By: Rémy HUBSCHER <hubscher.remy@gmail.com> * Remove useless variable and check json format * Use String.IO and test for wrong json * Remove coma Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
Fix spiral-project#417 * New tab upload * Extract data from JSON * Add users * Black format * Try to add bill * Import bills * Add french translation msg * Black reformat missing * Deactivated users are supported * Test import * Remove temp file in upload_json() * Incomplete tests * tests import * Update ihatemoney/translations/fr/LC_MESSAGES/messages.po Co-Authored-By: Rémy HUBSCHER <hubscher.remy@gmail.com> * Remove useless variable and check json format * Use String.IO and test for wrong json * Remove coma Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
In order to solve the issue #417, I added a tab to load a JSON, as well as a way to add the data found there, in an existing (or empty) project.
I realize that this was not the best way to manage the front end. But I couldn't add the form in the options section. So I did it like that to focus on the rest.
I had to add some messages, I have already noted their translation into French in
fr/LC_MESSAGES/messages.po