Commits

David Marble  committed bff9a7e Merge

merge username tag in activation email

  • Participants
  • Parent commits 2e6d5a1, e274f36

Comments (0)

Files changed (1)

File registration/models.py

         
         """
         for profile in self.all():
-            if profile.activation_key_expired():
-                user = profile.user
-                if not user.is_active:
-                    user.delete()
+            try:
+                if profile.activation_key_expired():
+                    user = profile.user
+                    if not user.is_active:
+                        user.delete()
+                        profile.delete()
+            except User.DoesNotExist:
+                profile.delete()
 
 
 class RegistrationProfile(models.Model):
             not). Consult the documentation for the Django sites
             framework for details regarding these objects' interfaces.
 
+        ``username``
+            The name used to register.
+
         """
         ctx_dict = {'activation_key': self.activation_key,
                     'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
-                    'site': site}
+                    'site': site,
+                    'username':self.user,
+                    }
         subject = render_to_string('registration/activation_email_subject.txt',
                                    ctx_dict)
         # Email subject *must not* contain newlines