Handle new CAS accounts
This commit is contained in:
parent
9e07f6806c
commit
387ca01dda
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ from django.db import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.contrib.gis.db import models as geomodels
|
from django.contrib.gis.db import models as geomodels
|
||||||
|
from django_cas_ng.signals import cas_user_authenticated
|
||||||
|
|
||||||
TYPE_STAGE_CHOICES = (
|
TYPE_STAGE_CHOICES = (
|
||||||
('stage', _(u"Stage")),
|
('stage', _(u"Stage")),
|
||||||
|
@ -27,6 +28,9 @@ class Normalien(models.Model):
|
||||||
return unicode(self.user.username)
|
return unicode(self.user.username)
|
||||||
|
|
||||||
|
|
||||||
|
if created:
|
||||||
|
cas_user_authenticated.connect(create_user_profile)
|
||||||
|
|
||||||
class Stage(models.Model):
|
class Stage(models.Model):
|
||||||
user = models.ForeignKey(Normalien, related_name = "stages")
|
user = models.ForeignKey(Normalien, related_name = "stages")
|
||||||
published = models.BooleanField(_("Visible publiquement"), default = False)
|
published = models.BooleanField(_("Visible publiquement"), default = False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue