Skip to content

Instantly share code, notes, and snippets.

@filipgorczynski
Created September 14, 2015 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipgorczynski/311f8d8a073f1f39ed74 to your computer and use it in GitHub Desktop.
Save filipgorczynski/311f8d8a073f1f39ed74 to your computer and use it in GitHub Desktop.
from django.contrib.auth.models import User
from django.db import models
class UserProfile(models.Model):
user = models.OneToOneField(User)
is_organization = models.BooleanField()
is_administrator = models.BooleanField()
def save(self):
super(UserProfile, self).save()
self.user.username = self.user.email
def __str__(self):
return self.email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment