diff --git a/djangosaml2/backends.py b/djangosaml2/backends.py index e7f36fc2..4701494a 100644 --- a/djangosaml2/backends.py +++ b/djangosaml2/backends.py @@ -20,9 +20,9 @@ from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured, MultipleObjectsReturned - from django.contrib import auth from django.contrib.auth.backends import ModelBackend +from django.http.request import HttpRequest logger = logging.getLogger("djangosaml2") @@ -166,14 +166,14 @@ def authenticate( # Update user with new attributes from incoming request if user is not None: user = self._update_user( - user, attributes, attribute_mapping, force_save=created + user, attributes, attribute_mapping, force_save=created, request=request ) if self.user_can_authenticate(user): return user def _update_user( - self, user, attributes: dict, attribute_mapping: dict, force_save: bool = False + self, user, attributes: dict, attribute_mapping: dict, force_save: bool = False, request: HttpRequest = None ): """Update a user with a set of attributes and returns the updated user. diff --git a/setup.py b/setup.py index c75d7bc4..44a3e4f6 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def read(*rnames): setup( name="djangosaml2", - version="1.5.3", + version="1.5.4", description="pysaml2 integration for Django", long_description=read("README.md"), long_description_content_type="text/markdown",