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

Bugfix #1080: "Deactivated users reappeared" #1104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chestnutFan
Copy link

@chestnutFan chestnutFan commented Dec 10, 2022

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.

@chestnutFan chestnutFan changed the title Adding the deactivated user check and corresponding test functions Bugfix #1080: "Deactivated users reappeared" Dec 11, 2022
Copy link
Member

@almet almet left a 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 :

  1. 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 ;
  2. 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
  3. 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.

ihatemoney/web.py Outdated Show resolved Hide resolved
ihatemoney/web.py Outdated Show resolved Hide resolved
@chestnutFan
Copy link
Author

Hi Almet! Thanks for reviewing my code. I rewrote the check function using the activated attribute, and moved it to the model.

@chestnutFan
Copy link
Author

chestnutFan commented Dec 13, 2022

Hi @almet! Tooltips have been added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deactivated users reappeared
2 participants