From 687efd0091b5ee487d7cb3a77bde93f17091a2d4 Mon Sep 17 00:00:00 2001
From: Art Lukyanchyk <artiom.lukyanchyk@hs-hannover.de>
Date: Thu, 18 Jan 2018 17:19:16 +0100
Subject: [PATCH] Fix user.is_active from being entirely ignored

---
 ssoauth/app_settings/defaults.py | 2 +-
 ssoauth/auth_utils.py            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ssoauth/app_settings/defaults.py b/ssoauth/app_settings/defaults.py
index 3733989..627512b 100644
--- a/ssoauth/app_settings/defaults.py
+++ b/ssoauth/app_settings/defaults.py
@@ -60,7 +60,7 @@ PRETEND_AUTH_BACKEND = django_settings.AUTHENTICATION_BACKENDS[0]  # pretend to
 
 
 """
-Not really settings...
+This information will be published in this SP metadata...
 """
 
 SP_CONTACTS = {
diff --git a/ssoauth/auth_utils.py b/ssoauth/auth_utils.py
index b528e00..3e6a9c4 100644
--- a/ssoauth/auth_utils.py
+++ b/ssoauth/auth_utils.py
@@ -136,8 +136,8 @@ def cleanup_direct_permissions(user):
         user.user_permissions.clear()
 
 
-def set_user_compat_flags(user):
-    is_active = True
+def set_user_compat_flags(user, user_is_active=True):
+    user.is_active = user_is_active
     user.is_staff = False
     user.is_superuser = False
     try:
-- 
GitLab