[schema] Add PermissionsMixin to UserProfile

This creates the required model fields to use the Django permissions
framework or various other third-party frameworks.

To apply this commit, run:

    python manage.py migrate zephyr

(imported from commit a14fa7552c5389522d15edecedfd8a34418bb23d)
This commit is contained in:
Luke Faraone
2013-06-24 08:51:10 -07:00
parent 9cb5c23da9
commit 93ce1ff431
2 changed files with 205 additions and 2 deletions

View File

@@ -2,7 +2,8 @@ from __future__ import absolute_import
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.contrib.auth.models import AbstractBaseUser, UserManager, \
PermissionsMixin
from zephyr.lib.cache import cache_with_key, update_user_profile_cache, \
user_profile_by_id_cache_key, user_profile_by_email_cache_key, \
update_user_presence_cache, generic_bulk_cached_fetch
@@ -65,7 +66,7 @@ class Realm(models.Model):
def __str__(self):
return self.__repr__()
class UserProfile(AbstractBaseUser):
class UserProfile(AbstractBaseUser, PermissionsMixin):
# Fields from models.AbstractUser minus last_name and first_name,
# which we don't use; email is modified to make it indexed and unique.
email = models.EmailField(blank=False, db_index=True, unique=True)