diff --git a/CHANGELOG.md b/CHANGELOG.md index adb4eb628..01e45bb33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,14 +16,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] -### Removed -* Remove support for Python 3.5 - ## [1.4.1] ### Changed * #925 OAuth2TokenMiddleware converted to new style middleware, and no longer extends MiddlewareMixin. +### Removed +* #936 Remove support for Python 3.5 + ## [1.4.0] 2021-02-08 ### Added diff --git a/oauth2_provider/models.py b/oauth2_provider/models.py index e1644e541..835fe24b2 100644 --- a/oauth2_provider/models.py +++ b/oauth2_provider/models.py @@ -401,12 +401,7 @@ def revoke(self): access_token_model = get_access_token_model() refresh_token_model = get_refresh_token_model() with transaction.atomic(): - try: - token = refresh_token_model.objects.select_for_update().filter( - pk=self.pk, revoked__isnull=True - ) - except refresh_token_model.DoesNotExist: - return + token = refresh_token_model.objects.select_for_update().filter(pk=self.pk, revoked__isnull=True) if not token: return self = list(token)[0] diff --git a/setup.cfg b/setup.cfg index ce656309c..22e81675e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-oauth-toolkit -version = 1.4.0 +version = 1.4.1 description = OAuth2 Provider for Django long_description = file: README.rst long_description_content_type = text/x-rst