1. Luke Leslie
  2. django-registration


ubernostrum  committed 6ed4763

Removing the key_generated field from RegistrationProfile

  • Participants
  • Parent commits 7f676bd
  • Branches default

Comments (0)

Files changed (2)

File docs/overview.txt

View file
  • Ignore whitespace
 .. _Django: http://www.djangoproject.com/
+The `latest released version`_ of this application is 0.1, and is
+quite stable; it's already been deployed on a number of sites. You can
+also obtain the absolute freshest code from `a Subversion checkout`_,
+but be warned that the code in SVN may not always be
+backwards-compatible, and may well contain bugs that haven't yet been
+.. _latest released version: http://django-registration.googlecode.com/files/registration-0.1.tar.gz
+.. _a Subversion checkout: http://django-registration.googlecode.com/svn/trunk/registration/

File registration/models.py

View file
  • Ignore whitespace
 class RegistrationProfile(models.Model):
-    Simple profile model for a User, storing a registration date and
-    an activation key for the account.
+    Simple profile model for a User, storing an activation key for the
+    account.
     While it is possible to use this model as the value of the
     ``AUTH_PROFILE_MODULE`` setting, it's not recommended that you do
     user = models.ForeignKey(User, unique=True)
     activation_key = models.CharField(maxlength=40)
-    key_generated = models.DateTimeField()
     objects = RegistrationManager()
     class Admin:
-    def save(self):
-        if not self.id:
-            self.key_generated = datetime.datetime.now()
-        super(RegistrationProfile, self).save()
     def __str__(self):
         return "User profile for %s" % self.user.username
         expiration_date = datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS)
-        return self.key_generated + expiration_date <= datetime.datetime.now()
+        return self.user.date_joined + expiration_date <= datetime.datetime.now()