-
Notifications
You must be signed in to change notification settings - Fork 274
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
Bugfix #1080: "Deactivated users reappeared" #1104
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for your work on this. It's leading the right way, but needs some changes before integration.
Some feedback :
- At all times, avoid copy-pasting code. Here the code to get the deactivated member list is in two different places. If we needed this code, it should probably go in the model instead ;
- I believe we don't actually need this code because the model can already tel us what are the deactivated members. Try to do this instead of building the list on your own
- In terms of UX, I believe it would be better to have a tooltip as I explained. I'm happy to change my mind on this if you have good arguments :-)
Anyway, thanks for taking the time to do this 👍. Let me know when you've made some edits.
Hi Almet! Thanks for reviewing my code. I rewrote the check function using the activated attribute, and moved it to the model. |
Hi @almet! Tooltips have been added. |
This is also true for deletion. Once a user is deactivated, all the related bills shouldn't be able to move.
This is a bit old now, but I wanted to continue working on it, as I'm currently in the process of tidying a bit this repository. I've rebased this on top of the latest Making it so that it's not possible doesn't actually seem right to me, as there are cases where we want to actually change this, for instance if a mistake was made. So, I'm planning on closing this and #1080 at the same time, unless somebody points me why we should do this. Cheers! |
Sounds reasonable to me. Glad to see this one finally been nailed :) |
Fixed #1080 by adding the deactivated member check. Corresponding test functions were also finished.
Details:
1. Added the deactivated member check for editing/deleting bills.
Compare the payer&owers list (POL) of the bill with the active member list (AML). If the relative complement of AML in POL (POL \ AML) is not empty, then the bill contains deactivated members and should not be edited/deleted.
2. Added two corresponding integration test functions.
Test:
Passed all the tests.