Fix: ContactForm
authorYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 17 Jan 2014 13:37:35 +0000 (14:37 +0100)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 17 Jan 2014 13:37:35 +0000 (14:37 +0100)
portal/contactview.py
portal/forms.py
portal/templates/contact-support-email.txt [new file with mode: 0644]

index 796c8b0..918385f 100644 (file)
@@ -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:
index df5c1a6..c7cb7f0 100644 (file)
@@ -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 (file)
index 0000000..b7733a0
--- /dev/null
@@ -0,0 +1,12 @@
+User details: 
+
+First name      : {{first_name}}
+Last name              : {{last_name}}
+email           : {{email}}
+Authority          : {{authority}}
+
+Query Details:
+
+Subject         : {{subject}}
+message         : {{message}}
+