diff options
Diffstat (limited to 'app/dispatchAuth/models.py')
| -rw-r--r-- | app/dispatchAuth/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/dispatchAuth/models.py b/app/dispatchAuth/models.py index 49e0a41..3132f1d 100644 --- a/app/dispatchAuth/models.py +++ b/app/dispatchAuth/models.py @@ -1,4 +1,5 @@ from django.contrib.auth.models import AbstractUser, AbstractBaseUser, PermissionsMixin, BaseUserManager +from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.db import models @@ -66,6 +67,11 @@ class User(PermissionsMixin, AbstractBaseUser): def __str__(self): return self.email + def email_user(self, subject, message, from_email=None, **kwargs): + """Send an email to this user.""" + send_mail(subject, message, from_email, [self.email], **kwargs) + + @property def is_staff(self): return self.is_superuser |
