From: Yasin <mohammed-yasin.rahman@lip6.fr>
Date: Fri, 17 Jan 2014 13:37:35 +0000 (+0100)
Subject: Fix: ContactForm
X-Git-Tag: myslice-0.3-0~30^2~3
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=dc0c3cef4b19067ee34234f295d8e96649add6f5;p=myslice.git

Fix: ContactForm
---

diff --git a/portal/contactview.py b/portal/contactview.py
index 796c8b04..918385f5 100644
--- a/portal/contactview.py
+++ b/portal/contactview.py
@@ -18,7 +18,7 @@ class ContactView (FreeAccessView):
             # Process the data in form.cleaned_data
             first_name = form.cleaned_data['first_name']
             last_name = form.cleaned_data['last_name']
-            affiliation = form.cleaned_data['affiliation']
+            authority = form.cleaned_data['authority']
             subject = form.cleaned_data['subject']
             message = form.cleaned_data['message']
             email = form.cleaned_data['email'] # email of the sender
@@ -29,7 +29,7 @@ class ContactView (FreeAccessView):
             if cc_myself:
                 recipients.append(email)
 
-            msg = render_to_string('slice-request-email.txt', form.cleaned_data)
+            msg = render_to_string('contact-support-email.txt', form.cleaned_data)
             send_mail("Onelab user %s submitted a query "%email, msg, email, recipients)
             return render(request,'contact_sent.html') # Redirect after POST
         else:
diff --git a/portal/forms.py b/portal/forms.py
index df5c1a67..c7cb7f06 100644
--- a/portal/forms.py
+++ b/portal/forms.py
@@ -56,7 +56,7 @@ from django.template import loader
 class ContactForm(forms.Form):
     first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
     last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
-    affiliation = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
+    authority = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
     email = forms.EmailField(widget=forms.TextInput(attrs={'class':'form-control'}))
     subject = forms.CharField(max_length=100,widget=forms.TextInput(attrs={'class':'form-control'}))
     message = forms.CharField(widget=forms.Textarea(attrs={'class':'form-control'}))
diff --git a/portal/templates/contact-support-email.txt b/portal/templates/contact-support-email.txt
new file mode 100644
index 00000000..b7733a07
--- /dev/null
+++ b/portal/templates/contact-support-email.txt
@@ -0,0 +1,12 @@
+User details: 
+
+First name      : {{first_name}}
+Last name 		: {{last_name}}
+email           : {{email}}
+Authority	    : {{authority}}
+
+Query Details:
+
+Subject         : {{subject}}
+message         : {{message}}
+