Anonymous avatar Anonymous committed 6ed4763

Removing the key_generated field from RegistrationProfile

Comments (0)

Files changed (2)

docs/overview.txt

 .. _Django: http://www.djangoproject.com/
 
 
+Development
+===========
+
+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
+fixed.
+
+.. _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/
+
+
 Dependencies
 ============
 

registration/models.py

 
 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:
         pass
     
-    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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.