Commits

Peter Sanchez  committed 691c195

Updated baseacct/models to subclass UserManager

  • Participants
  • Parent commits 5a5aa8f
  • Branches trunk

Comments (0)

Files changed (1)

File webutils/baseacct/models.py

 from django.conf import settings
 from django.db import models
-from django.contrib.auth.models import User
+from django.contrib.auth.models import UserManager, User
 from django.utils.translation import ugettext_lazy as _
 from webutils.djtools.email import send_simple_email
 
 
-class BaseUserProfileManager(models.Manager):
+class BaseUserProfileManager(UserManager):
     def generate_hash(self):
         import hashlib
         import random
         )
 
     def add_new_user(self, username, password, email, first_name, last_name):
-        new_user = User.objects.create_user(username, email, password)
+        new_user = self.create_user(username, email, password)
         new_user.first_name = first_name
         new_user.last_name = last_name
         new_user.is_active = True