From c83fa3718dd3f2fcddb14bcc559317b10352a6e8 Mon Sep 17 00:00:00 2001 From: Alan Crosswell Date: Sat, 19 Mar 2022 14:22:30 -0400 Subject: [PATCH 1/2] Revert #1070: tasks.py raises an import exception with Celery and conflicts with Huey. --- CHANGELOG.md | 3 +++ docs/management_commands.rst | 5 ----- oauth2_provider/tasks.py | 8 -------- 3 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 oauth2_provider/tasks.py diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b10068b..53a83547f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 by [RFC 8252](https://datatracker.ietf.org/doc/html/rfc8252) "OAuth 2.0 for Native Apps" BCP. Google has [deprecated use of oob](https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob) with a final end date of 2022-10-03. If you still rely on oob support in django-oauth-toolkit, do not upgrade to this release. +* #1126 Reverts #1070 which incorrectly added Celery auto-discovery tasks.py (as described in #1123) and because it conflicts + with Huey's auto-discovery which also uses tasks.py as described in #1114. If you are using Celery or Huey, you'll need + to separately implement these tasks. ## [1.7.0] 2022-01-23 diff --git a/docs/management_commands.rst b/docs/management_commands.rst index 727ff9e98..147a0bbe4 100644 --- a/docs/management_commands.rst +++ b/docs/management_commands.rst @@ -21,8 +21,3 @@ To prevent the CPU and RAM high peaks during deletion process use ``CLEAR_EXPIRE Note: Refresh tokens need to expire before AccessTokens can be removed from the database. Using ``cleartokens`` without ``REFRESH_TOKEN_EXPIRE_SECONDS`` has limited effect. - -The ``cleartokens`` action can also be scheduled as a `Celery periodic task`_ -by using the ``clear_tokens`` task (automatically registered when using Celery). - -.. _Celery periodic task: https://docs.celeryproject.org/en/stable/userguide/periodic-tasks.html diff --git a/oauth2_provider/tasks.py b/oauth2_provider/tasks.py deleted file mode 100644 index d86c33720..000000000 --- a/oauth2_provider/tasks.py +++ /dev/null @@ -1,8 +0,0 @@ -from celery import shared_task - - -@shared_task -def clear_tokens(): - from ...models import clear_expired # noqa - - clear_expired() From 1a821e0eac6fbaca76577ad7d05819ff2f6f2558 Mon Sep 17 00:00:00 2001 From: Alan Crosswell Date: Sat, 19 Mar 2022 15:49:47 -0400 Subject: [PATCH 2/2] Update CHANGELOG to show that this is in 1.7.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53a83547f..e6b089f5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 by [RFC 8252](https://datatracker.ietf.org/doc/html/rfc8252) "OAuth 2.0 for Native Apps" BCP. Google has [deprecated use of oob](https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob) with a final end date of 2022-10-03. If you still rely on oob support in django-oauth-toolkit, do not upgrade to this release. + +## [1.7.1] 2022-03-19 + +### Removed * #1126 Reverts #1070 which incorrectly added Celery auto-discovery tasks.py (as described in #1123) and because it conflicts with Huey's auto-discovery which also uses tasks.py as described in #1114. If you are using Celery or Huey, you'll need to separately implement these tasks.