[chores] Update Celery beat schedule logic for user deactivation
Context:
- The user expiration logic will change in openwisp-users#499:
- openwisp-users introduces a periodic task that deactivates users with a past expiration date and sends notification emails (idempotent, timezone-aware, configurable reminders, etc).
- openwisp-radius#706 will remove the local deactivation logic in favor of unified handling in openwisp-users.
Current logic in docker-openwisp:
- The Celery beat schedule for deactivating users is only enabled and executed when openwisp-radius is present/enabled. This check will become obsolete since the expiration and deactivation logic will fully reside in openwisp-users.
Required changes:
- Update how the Celery beat job for user deactivation is scheduled:
- The periodic task should not depend on openwisp-radius being enabled.
- The task for user deactivation (as per new openwisp-users implementation) should always be scheduled if openwisp-users is present.
- Review orchestration, template logic, and docs as needed to ensure the correct and always-on scheduling of this job.
- Remove any outdated conditions/checks that couple task scheduling to openwisp-radius.
Now that all related issues, including https://github.com/openwisp/ansible-openwisp2/pull/615 are done, we can proceed with this one. Help is welcome.
Hi @nemesifier and @pandafy,
I have identified the issue, and the fix requires official releases of openwisp-users and openwisp-radius. The Celery related PRs for both projects have already been merged into the master branch, but the corresponding releases have not yet been published on PyPI.
As a result, the solution currently requires installing from the master branch rather than using the official PyPI releases. Until updated versions of both packages are published on PyPI, I believe this issue is blocked from receiving a proper solution and would otherwise require a workaround instead of a clean, maintainable fix.