1 from django.db import models
2 from cas_provider.signals import cas_collect_custom_attributes
5 class Service(models.Model):
6 ordering = models.IntegerField()
7 name = models.CharField(max_length=255)
8 url = models.URLField()
9 image = models.ImageField(upload_to='accounts/service/')
12 ordering = ('ordering', )
15 def user_attributes(sender, user, **kwargs):
17 'firstname': user.first_name,
18 'lastname': user.last_name,
19 'cn': ' '.join((user.first_name, user.last_name)),
22 cas_collect_custom_attributes.connect(user_attributes)