use template for receipt too
This commit is contained in:
parent
b9c6bfe196
commit
b131c6ba96
3 changed files with 16 additions and 3 deletions
|
@ -38,7 +38,7 @@ def _order_query(qs, sort, prefix='sort__'):
|
||||||
sort.append({'operator': '+', 'key': 'director'})
|
sort.append({'operator': '+', 'key': 'director'})
|
||||||
elif sort[0]['key'] == 'director':
|
elif sort[0]['key'] == 'director':
|
||||||
sort.append({'operator': '-', 'key': 'year'})
|
sort.append({'operator': '-', 'key': 'year'})
|
||||||
sort.append({'operator': '-', 'key': 'title'})
|
sort.append({'operator': '+', 'key': 'title'})
|
||||||
elif sort[0]['key'] == 'year':
|
elif sort[0]['key'] == 'year':
|
||||||
sort.append({'operator': '+', 'key': 'director'})
|
sort.append({'operator': '+', 'key': 'director'})
|
||||||
sort.append({'operator': '+', 'key': 'title'})
|
sort.append({'operator': '+', 'key': 'title'})
|
||||||
|
@ -46,7 +46,6 @@ def _order_query(qs, sort, prefix='sort__'):
|
||||||
sort.append({'operator': '+', 'key': 'director'})
|
sort.append({'operator': '+', 'key': 'director'})
|
||||||
sort.append({'operator': '-', 'key': 'year'})
|
sort.append({'operator': '-', 'key': 'year'})
|
||||||
sort.append({'operator': '+', 'key': 'title'})
|
sort.append({'operator': '+', 'key': 'title'})
|
||||||
|
|
||||||
for e in sort:
|
for e in sort:
|
||||||
operator = e['operator']
|
operator = e['operator']
|
||||||
if operator != '-':
|
if operator != '-':
|
||||||
|
|
7
pandora/user/templates/contact_receipt.txt
Normal file
7
pandora/user/templates/contact_receipt.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{name}},
|
||||||
|
thanks for your message, we will get back to you shortly.
|
||||||
|
here your message for forther reference
|
||||||
|
{{message}}
|
||||||
|
|
||||||
|
--
|
||||||
|
{{sitename}}
|
|
@ -561,7 +561,14 @@ def contact(request):
|
||||||
if request.user.is_authenticated() \
|
if request.user.is_authenticated() \
|
||||||
and 'receipt' in data \
|
and 'receipt' in data \
|
||||||
and data['receipt']:
|
and data['receipt']:
|
||||||
message = data['message'].strip()
|
template = loader.get_template('contact_receipt.txt')
|
||||||
|
context = RequestContext(request, {
|
||||||
|
'email': email,
|
||||||
|
'message': data['message'].strip(),
|
||||||
|
'name': name,
|
||||||
|
'sitename': settings.SITENAME,
|
||||||
|
})
|
||||||
|
message = template.render(context)
|
||||||
try:
|
try:
|
||||||
send_mail(subject.strip(), message, email_from, [email])
|
send_mail(subject.strip(), message, email_from, [email])
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in a new issue