# HG changeset patch
# User nishanth
# Date 1271341432 -19800
# Node ID a26c82f593f048f478d94cd1e6bbff5dade3f094
# Parent d321a507fc268959431a1f38f288aab951cbac61
implemented send activation. have to test it and do the same for change password.
diff -r d321a507fc26 -r a26c82f593f0 reg/events.py
--- a/reg/events.py Thu Apr 15 19:19:08 2010 +0530
+++ b/reg/events.py Thu Apr 15 19:53:52 2010 +0530
@@ -41,7 +41,26 @@
""" get key from profile and send an email.
"""
- print "http://localhost:8000/reg/activate/%s"%user.get_profile().activation_key
+ activation_link = "http://localhost:8000/reg/activate/%s"%user.get_profile().activation_key
+ subject = "Activate your account"
+ message = """
+ Dear %s,
+
+ Thank you for registering at fossee.in.
+ Your are just a step away from completeing your registration.
+ Please click on the link below or open the url in your browser to activate your account.
+ %s
+
+ Please mail your queries and complaints to admin@fossee.in.
+
+ If you have not registered at fossee, please ignore this mail.
+
+ Regards,
+ FOSSEE Team
+ """%(user.get_full_name(), activation_link)
+ print message
+ send_mail(subject, message, "admin@fossee.in", [user.email])
+
def create_event(title, description, start_date, stop_date, venue, created_by=None):
""" make an event and save it.
diff -r d321a507fc26 -r a26c82f593f0 reg/views.py
--- a/reg/views.py Thu Apr 15 19:19:08 2010 +0530
+++ b/reg/views.py Thu Apr 15 19:53:52 2010 +0530
@@ -89,11 +89,10 @@
interests=data['interests']
)
- reg_events.send_activation(new_user)
if event:
event.attendees.add(new_user)
event.save()
-
+ reg_events.send_activation(new_user)
return redirect('/reg/account_created')
else:
return render_to_response('register.html', {'form':form, 'event':event})
@@ -114,7 +113,7 @@
"""
user = request.user
- if user.is_authenticated():
+ if user.is_authenticated() and user.is_active:
return redirect('/reg')
try:
diff -r d321a507fc26 -r a26c82f593f0 templates/index.html
--- a/templates/index.html Thu Apr 15 19:19:08 2010 +0530
+++ b/templates/index.html Thu Apr 15 19:53:52 2010 +0530
@@ -19,7 +19,7 @@
{% endif %}
{% else %}
Your account is inactive. An activation email has been sent to your email address.
- Click here to resend the activation email.
+ Click here to resend the activation email.
{% endif %}
{% endif %}