Bump django from 2.2.4 to 2.2.8
[cas.git] / src / accounts / models.py
index 71a8362..b0be8d4 100644 (file)
@@ -1,3 +1,11 @@
-from django.db import models
+from cas_provider.signals import cas_collect_custom_attributes
 
-# Create your models here.
+
+def user_attributes(sender, user, **kwargs):
+    return {
+        'firstname': user.first_name,
+        'lastname': user.last_name,
+        'cn': ' '.join((user.first_name, user.last_name)),
+        'email': user.email,
+    }
+cas_collect_custom_attributes.connect(user_attributes)