equal
deleted
inserted
replaced
|
1 """Helper script to send an email to all users who registered |
|
2 before activation logic was implemented. This script can be |
|
3 run only within a Django shell. |
|
4 """ |
|
5 |
|
6 |
|
7 __authors__ = [ |
|
8 '"Madhusudan.C.S" <madhusudancs@gmail.com>', |
|
9 ] |
|
10 |
|
11 |
|
12 from datetime import datetime |
|
13 |
|
14 from django.template import loader |
|
15 |
|
16 from registration.models import RegistrationProfile |
|
17 |
|
18 |
|
19 def remind_users(): |
|
20 regs = RegistrationProfile.objects.filter( |
|
21 user__is_active=0, |
|
22 user__date_joined__lte=datetime(2009, 10, 13)) |
|
23 |
|
24 template = 'notifications/activate_mail.html' |
|
25 |
|
26 for reg in regs: |
|
27 |
|
28 subject = "Update and activate your SciPy.in registration." |
|
29 message = loader.render_to_string(template, dictionary={'activation_key': reg.activation_key}) |
|
30 |
|
31 reg.user.email_user(subject=subject, message=message) |
|
32 |