From 0ede9ee6b1c52570abebc0b193f32dd60f518547 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 16 Jul 2024 12:10:18 -0400 Subject: [PATCH] Bugfix: is_anonymous is an attribute in Django2.0+. Bump version --- README.md | 1 + oauthadmin/views.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fed494..8676be8 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ When the CSRF validation token doesn't match, django-admin-oauth2 will redirect ## Changelog +- 1.3.4: Bugfix: is_anonymous is now an attribute, fixes Django 2.0+ - 1.3.3: Bugfix: forgot import in view - 1.3.2: Fix bug: Don't try to serialize an anonymous user - 1.3.1: Update setup.py so pypi README docs are formatted diff --git a/oauthadmin/views.py b/oauthadmin/views.py index 2967a86..2ee4856 100644 --- a/oauthadmin/views.py +++ b/oauthadmin/views.py @@ -85,7 +85,7 @@ def callback(request): user = import_by_path(app_setting('GET_USER'))(token) - if user.is_anonymous(): + if user.is_anonymous: return HttpResponseRedirect(reverse(oauthadmin.views.no_permissions)) serialized_user = serializers.serialize("json", [user]) diff --git a/setup.py b/setup.py index d13fe5a..1ea54f3 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup( name='django-admin-oauth2', - version='1.3.3', + version='1.3.4', description='A django app that replaces the django admin authentication mechanism by deferring to an oauth2 provider', long_description=README, long_description_content_type='text/markdown',