From c84eec9af1965d95e8a77f4e63c6c5f833b85d39 Mon Sep 17 00:00:00 2001
From: David Schmitz <schmitz@lrz.de>
Date: Fri, 30 Jun 2023 09:27:38 +0000
Subject: [PATCH] shibboleth attribute migration: fixup

---
 flowspec/views.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/flowspec/views.py b/flowspec/views.py
index 76e002b2..fc9a575c 100644
--- a/flowspec/views.py
+++ b/flowspec/views.py
@@ -911,13 +911,14 @@ def user_login(request):
           except:
             pass
 
-        user_dict = model_to_dict(user)
-        rule_changelog_logger.info("login user="+str(user.username)+": "+str(user_dict))
-
         user = authenticate(username=username, firstname=firstname, lastname=lastname, mail=mail, authsource='shibboleth')
         logger.debug('Authentication of %s' % user)
 
         if user is not None:
+
+            user_dict = model_to_dict(user)
+            rule_changelog_logger.info("login user="+str(user.username)+": "+str(user_dict))
+
             try:
                 user.userprofile.peers.all()
             except:
-- 
GitLab