fix reset password email template astakos/v0.2.0
authorSofia Papagiannaki <papagian@gmail.com>
Tue, 21 Feb 2012 14:54:48 +0000 (16:54 +0200)
committerSofia Papagiannaki <papagian@gmail.com>
Tue, 21 Feb 2012 14:54:48 +0000 (16:54 +0200)
astakos/im/forms.py
astakos/im/templates/registration/password_email.txt

index 1f3ea5b..82dbcd6 100644 (file)
@@ -30,6 +30,7 @@
 # documentation are those of the authors and should not be
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
+from urlparse import urljoin
 
 from django import forms
 from django.utils.translation import ugettext as _
@@ -222,14 +223,16 @@ class ExtendedPasswordResetForm(PasswordResetForm):
         Generates a one-use only link for resetting password and sends to the user.
         """
         for user in self.users_cache:
+            url = urljoin(BASEURL,
+                          '/im/local/reset/confirm/%s-%s' %(int_to_base36(user.id),
+                                                            token_generator.make_token(user)))
             t = loader.get_template(email_template_name)
             c = {
                 'email': user.email,
-                'domain': BASEURL,
+                'url': url,
                 'site_name': SITENAME,
-                'uid': int_to_base36(user.id),
                 'user': user,
-                'token': token_generator.make_token(user)
+                'baseurl': BASEURL
             }
             from_email = DEFAULT_FROM_EMAIL
             send_mail(_("Password reset on %s") % SITENAME,
index c7d12bb..7d63feb 100644 (file)
@@ -3,7 +3,7 @@
 για την υπηρεσία {{ site_name }} της ΕΔΕΤ κατά την Alpha (πιλοτική) φάση λειτουργίας της,
 χρησιμοποιήστε τον παρακάτω σύνδεσμο:
 
-{{ domain }}/im/local/reset/confirm/{{ uid }}-{{ token }}/
+{{url}}
 
 Σημείωση:
 
@@ -17,7 +17,7 @@
 έκδοση Alpha στην έκδοση Beta. Θα υπάρξει έγκαιρη ειδοποίησή σας πριν
 από τη μετάβαση αυτή.
 
-Περισσότερα για την υπηρεσία θα βρείτε στο {{ domain }}/, αφού
+Περισσότερα για την υπηρεσία θα βρείτε στο {{ baseurl }}, αφού
 ενεργοποιήσετε την πρόσκλησή σας.
 
 Για όποιες παρατηρήσεις ή προβλήματα στη λειτουργεία της υπηρεσίας μπορείτε να
@@ -36,7 +36,7 @@
 
 You can use the following link:
 
-{{ domain }}/local/reset/confirm/{{ uid }}-{{ token }}/
+{{ url }}
 
 to reset your password for GRNET's {{ site_name }} service has been created
 for its Alpha test phase.
@@ -53,7 +53,7 @@ request you not to transfer important files to {{ site_name}} yet.
 Also, please bear in mind that all data will be deleted when the service moves to Beta.
 We will notify you before the transition.
 
-For more information, please visit {{ domain }}/, after
+For more information, please visit {{ baseurl }}, after
 activating your invitation.
 
 We look forward to your feedback, to improve the functionality and