created view for sending acco_confirm anoop
authornishanth
Mon, 26 Jul 2010 18:02:24 +0530
branchanoop
changeset 178 f87248c912b4
parent 177 bbcf2a7d8b6b
child 179 ac558619d49d
created view for sending acco_confirm
sdi/events.py
sdi/views.py
templates/send_acco_cnf.html
--- a/sdi/events.py	Mon Jul 26 17:49:47 2010 +0530
+++ b/sdi/events.py	Mon Jul 26 18:02:24 2010 +0530
@@ -121,7 +121,24 @@
 
     send_mail(subject, message, "sagedays@fossee.in", [user.email])
 
+def send_acco_confirm(user, message):
+    """ take the given message and add it to main message and send the mail.
+    """
 
+    subject = "Sage Days 25, India - Accomodation arranged"
+
+    main_message="""
+Dear %s %s,
+
+Your request for accomodation during Sage Days 25, India has been accepted.
+
+%s
+
+Thanking you,
+
+Sage Days India Team,
+FOSSEE, IIT Bombay.
+    """%(user.first_name.title(), user.last_name.title(),message)
 
 
 def mail_invi(to_emails):
--- a/sdi/views.py	Mon Jul 26 17:49:47 2010 +0530
+++ b/sdi/views.py	Mon Jul 26 18:02:24 2010 +0530
@@ -183,7 +183,7 @@
     not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3", 
                                                  registrantinfo__status_of_accomodation="1")
 
-    user_choices = list(rejected_ppl) + list(selected_ppl) + list(not_selected_ppl)
+    user_choices = list(rejected_ppl) + list(not_selected_ppl)
     form = UserSelectForm(user_choices, request.POST)
 
     if request.method == "POST" and form.is_valid():
@@ -192,6 +192,8 @@
             user_info = user.registrantinfo_set.all()[0]
             user_info.status_of_accomodation = "2"
             user_info.save()
+
+	    message = form.cleaned_data['message']
         
         return render_to_response("sent_acco_confirm.html", {"selected_users":selected_users})
     else:
--- a/templates/send_acco_cnf.html	Mon Jul 26 17:49:47 2010 +0530
+++ b/templates/send_acco_cnf.html	Mon Jul 26 18:02:24 2010 +0530
@@ -10,7 +10,7 @@
 Your request for accomodation during Sage Days 25, India has been approved.
 <br />
 message:<br />
-<textarea name="message" rows=15 cols=40></textarea>
+<textarea name="message" rows=15 cols=120></textarea>
 
 Not Selected ppl: {{not_selected.count}}<br >
 <table cellspacing=2 cellpadding=2>