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

Delete participations of long inactive users #2329

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

Redflashx12
Copy link
Collaborator

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..

Copy link
Member

@richardebeling richardebeling left a 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.

evap/settings.py Outdated Show resolved Hide resolved
evap/staff/tests/test_tools.py Outdated Show resolved Hide resolved
evap/staff/tests/test_tools.py Outdated Show resolved Hide resolved
evap/staff/tests/test_tools.py Outdated Show resolved Hide resolved
evap/staff/tests/test_tools.py Outdated Show resolved Hide resolved
evap/staff/tests/test_tools.py Outdated Show resolved Hide resolved
evap/staff/tools.py Outdated Show resolved Hide resolved
evap/staff/tools.py Outdated Show resolved Hide resolved
evap/staff/tools.py Outdated Show resolved Hide resolved
evap/staff/tools.py Outdated Show resolved Hide resolved
@Redflashx12
Copy link
Collaborator Author

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.

Thanks for your time in reviewing this PR, especially for all the fixes and explanations. Much appreciated 👍.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_("{} 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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
]

@niklasmohrin
Copy link
Member

@Redflashx12 Do you want to keep working on this PR (this or next year), or should we take over?

@Redflashx12
Copy link
Collaborator Author

Redflashx12 commented Dec 16, 2024 via email

@niklasmohrin
Copy link
Member

Great, good luck with that! No need to worry or hurry, we just want to track the status of the PR :)

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

Successfully merging this pull request may close these issues.

Delete participations of long inactive users
4 participants