From 69d5a098f830128414f178d9382c65221f06e4bb Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 10 Nov 2017 15:25:29 -0500 Subject: Initial version of registration system--needs work --- app/dispatchAuth/models.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/dispatchAuth/models.py') 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 -- cgit v1.2.3