X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/37e278e43ece42375352c07d9f04991ef58d992c..efd1292d83f2371cba42a41a9480963acd5dd5bc:/src/accounts/models.py diff --git a/src/accounts/models.py b/src/accounts/models.py index 71a8362..b0be8d4 100644 --- a/src/accounts/models.py +++ b/src/accounts/models.py @@ -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)