From 6aa656e3610a9ff53ce817ca8603929f99bdad9c Mon Sep 17 00:00:00 2001 From: juanifioren Date: Wed, 5 Aug 2015 13:19:53 -0300 Subject: [PATCH] Remove UserInfo Model. --- oidc_provider/models.py | 57 ----------------------------------------- 1 file changed, 57 deletions(-) diff --git a/oidc_provider/models.py b/oidc_provider/models.py index e6bbdfa..46957e4 100644 --- a/oidc_provider/models.py +++ b/oidc_provider/models.py @@ -87,63 +87,6 @@ class Token(BaseCodeTokenModel): id_token = property(**id_token()) -class UserInfo(models.Model): - - GENDER_CHOICES = [ - ('F', 'Female'), - ('M', 'Male'), - ] - - user = models.OneToOneField(settings.AUTH_USER_MODEL, primary_key=True) - given_name = models.CharField(max_length=255, blank=True, null=True) - family_name = models.CharField(max_length=255, blank=True, null=True) - middle_name = models.CharField(max_length=255, blank=True, null=True) - nickname = models.CharField(max_length=255, blank=True, null=True) - gender = models.CharField(max_length=100, choices=GENDER_CHOICES, null=True) - birthdate = models.DateField(null=True) - zoneinfo = models.CharField(max_length=100, default='', blank=True, - null=True) - locale = models.CharField(max_length=100, default='', blank=True, null=True) - preferred_username = models.CharField(max_length=255, blank=True, null=True) - profile = models.URLField(default='', null=True, blank=True) - picture = models.URLField(default='', null=True, blank=True) - website = models.URLField(default='', null=True, blank=True) - email_verified = models.NullBooleanField(default=False) - locale = models.CharField(max_length=100, blank=True, null=True) - phone_number = models.CharField(max_length=255, blank=True, null=True) - phone_number_verified = models.NullBooleanField(default=False) - address_street_address = models.CharField(max_length=255, blank=True, - null=True) - address_locality = models.CharField(max_length=255, blank=True, null=True) - address_region = models.CharField(max_length=255, blank=True, null=True) - address_postal_code = models.CharField(max_length=255, blank=True, - null=True) - address_country = models.CharField(max_length=255, blank=True, null=True) - updated_at = models.DateTimeField(auto_now=True, null=True) - - @property - def name(self): - name = '' - if self.given_name: - name = self.given_name - if self.family_name: - name = name + ' ' + self.family_name - - return name - - @property - def address_formatted(self): - formatted = ', '.join([ - self.address_street_address or '', - self.address_locality or '', - self.address_country or '']) - - if formatted.startswith(', '): - formatted = formatted[2:] - if formatted.endswith(', '): - formatted = formatted[:-2] - - class UserConsent(BaseCodeTokenModel): pass