aboutsummaryrefslogtreecommitdiff
path: root/app/dispatchAuth/models.py
diff options
context:
space:
mode:
authorMitch Riedstra <Mitch@riedstra.us>2017-11-10 15:25:29 -0500
committerMitch Riedstra <Mitch@riedstra.us>2017-11-10 15:25:29 -0500
commit69d5a098f830128414f178d9382c65221f06e4bb (patch)
tree0a0d6346d5b39634e19ce01689498d9ccf4e867c /app/dispatchAuth/models.py
parentc80bafec506beef3184381ae7f9b55edd438e45a (diff)
downloaddispatch-tracker-69d5a098f830128414f178d9382c65221f06e4bb.tar.gz
dispatch-tracker-69d5a098f830128414f178d9382c65221f06e4bb.tar.xz
Initial version of registration system--needs work
Diffstat (limited to 'app/dispatchAuth/models.py')
-rw-r--r--app/dispatchAuth/models.py6
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