-
Notifications
You must be signed in to change notification settings - Fork 133
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 User Functionality Updates #1844
Conversation
4d95d1f
to
9e53807
Compare
onadata/settings/common.py
Outdated
CELERY_BEAT_SCHEDULE = { | ||
'Mark-Expired-Exports-Failed': { | ||
'task': | ||
'onadata.apps.viewer.tasks.mark_expired_pending_exports_as_failed', | ||
'schedule': crontab(hour='*', minute='0'), | ||
'options': {'ignore_result': True} | ||
}, | ||
'Delete-Expired-Failed-Exports': { | ||
'task': 'onadata.apps.viewer.tasks.delete_expired_failed_exports', | ||
'schedule': crontab(hour='*', minute='10'), | ||
'options': {'ignore_result': True} | ||
}, | ||
'celery.backend_cleanup': { | ||
'task': 'celery.backend_cleanup', | ||
'schedule': crontab(hour='*', minute='30'), | ||
'options': {'ignore_result': True} | ||
}, | ||
'Delete-Inactive-Users': { | ||
'task': 'onadata.apps.api.tasks.delete_user_async', | ||
'schedule': crontab( | ||
0, 0, day_of_month='30'), # Execute on the 30th of every month. | ||
'options': {'ignore_result': True} | ||
}, | ||
} | ||
|
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.
I don't think this configuration should be placed within the common
settings..... Celery beat scheduling seems like something the user should configure within their own local settings IMO
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.
Places this here since the tasks are things that should run in all environments/deployments of onadata
Im unsure which settings file would be a better fit for this configurations.
Cc: @ivermac
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.
It generally looks good. I've added a question and a couple of comments
onadata/settings/common.py
Outdated
'Delete-Inactive-Users': { | ||
'task': 'onadata.apps.api.tasks.delete_user_async', | ||
'schedule': crontab( | ||
0, 0, day_of_month='30'), # Execute on the 30th of every month. |
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.
@WinnyTroy What about the month of February? Can we consider may be the 1st day of every month?
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.
I agree with @DavisRayM on having the configuration on a user's local settings file
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.
That said, I like the fact that functionality will be scheduled and executed once a month
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.
Alright, sure, I'll remove this configurations from here.
And I see no problem with having this run on the 1st of every month. Let me change that
00aa23c
to
5fd0378
Compare
"User Ken deleted successfully.", | ||
out.getvalue()) | ||
|
||
with self.assertRaises(ObjectDoesNotExist): |
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.
Tiny thing/change.... Please use User.DoesNotExist
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.
Cool cool. Changed that.
7e00fbf
to
d23c866
Compare
d23c866
to
0690698
Compare
…ally perform task
0690698
to
96a51d2
Compare
Included deletion suffix to email associated with the user account
Included cron task to periodically perform task after 30 days
Closes #1843