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

Add changes to activate cron job that deletes old applications 7 days after role appointment is done and saved #795

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

anandmatt
Copy link

Description of the Change

Cron job that was supposed to delete old applications had no implementation. Changes done to call this cron job to delete old applications that were turned down, 7 days after a role has been appointed and saved.

Applicable Issues

Fixes issue #786

feature

@anandmatt anandmatt linked an issue Nov 30, 2023 that may be closed by this pull request
@robindymer robindymer self-requested a review December 6, 2023 17:38
@ludvigalden ludvigalden requested review from ludvigalden and removed request for robindymer January 26, 2024 17:01
Copy link
Contributor

@ludvigalden ludvigalden left a comment

Choose a reason for hiding this comment

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

Any idea why the CRON-job might not be invoked by django-kronos, @anandmatt?

).exclude(
status='appointed'
).filter(
status='turned_down'
Copy link
Contributor

Choose a reason for hiding this comment

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

The change to remove only turned_down applications is good, because currently, it expects that applications are appointed within a week of the application end date, which is not always the case. The status is set to turned_down only when they have been appointed.

@@ -99,3 +100,4 @@ def save(self):
if not created:
appl.status = 'appointed'
appl.save()
cron.remove_old_applications()
Copy link
Contributor

Choose a reason for hiding this comment

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

So a CRON-job is not supposed to be invoked manually, by definition. Unless there is some issue with django-kronos not installing the CRON-jobs correctly, I don't think there is any problem in terms of remove_old_applications not being called. The crontab on the server looks fine. So I think the change to invoke it without django-kronos should be removed.

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.

Delete old applications
3 participants