-
Notifications
You must be signed in to change notification settings - Fork 147
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
Delete participations of long inactive users #2329
base: main
Are you sure you want to change the base?
Conversation
…default of 18 months
…ing months to seconds
…or vote start/end date instead of flat value
…ed as "can_be_marked_inactive_by_manager"
…ed to add +1 to get above threshold
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.
Good work so far! Sorry, quite a few comments added up, this could be a bit overwhelming. We want to address everything so we don't get stuck in endless review loops. We're always happy to help out and answer any questions, so make sure to ask if anything is unclear.
Co-authored-by: Richard Ebeling <[email protected]>
Co-authored-by: Richard Ebeling <[email protected]>
Thanks for your time in reviewing this PR, especially for all the fixes and explanations. Much appreciated 👍. |
…r as participant and add beginning check for user.evaluations_participating_in.exists()
evaluation_count = user.evaluations_participating_in.count() | ||
if test_run: | ||
return [ | ||
_("{} will be removed from {} participation(s) due to inactivity.").format(user.full_name, evaluation_count) |
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.
_("{} will be removed from {} participation(s) due to inactivity.").format(user.full_name, evaluation_count) | |
ngettext( | |
"{} participation of {} would be removed due to inactivity.", | |
"{} participations of {} would be removed due to inactivity.", | |
evaluation_count, | |
).format(evaluation_count, user.full_name) |
_("{} will be removed from {} participation(s) due to inactivity.").format(user.full_name, evaluation_count) | ||
] | ||
user.evaluations_participating_in.clear() | ||
return [_("Removed {} from {} participation(s) due to inactivity.").format(user.full_name, evaluation_count)] |
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.
return [_("Removed {} from {} participation(s) due to inactivity.").format(user.full_name, evaluation_count)] | |
return [ | |
ngettext( | |
"{} participation of {} was removed due to inactivity.", | |
"{} participations of {} were removed due to inactivity.", | |
evaluation_count, | |
).format(evaluation_count, user.full_name) | |
] |
Fixes #2176.
Additionally added two test in class RemoveUserDueToInactivity. During test run of "Bulk update users" in the web with evap/staff/fixtures/test_user_bulk_update_file.txt, Lyndsey Lattimore should get removed from 1 participation(s) due to inactivity..