diff --git a/pandora/item/views.py b/pandora/item/views.py index edad1c224..a845832c7 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -38,7 +38,7 @@ def _order_query(qs, sort, prefix='sort__'): sort.append({'operator': '+', 'key': 'director'}) elif sort[0]['key'] == 'director': sort.append({'operator': '-', 'key': 'year'}) - sort.append({'operator': '-', 'key': 'title'}) + sort.append({'operator': '+', 'key': 'title'}) elif sort[0]['key'] == 'year': sort.append({'operator': '+', 'key': 'director'}) 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': 'year'}) sort.append({'operator': '+', 'key': 'title'}) - for e in sort: operator = e['operator'] if operator != '-': diff --git a/pandora/user/templates/contact_receipt.txt b/pandora/user/templates/contact_receipt.txt new file mode 100644 index 000000000..99e5f4be0 --- /dev/null +++ b/pandora/user/templates/contact_receipt.txt @@ -0,0 +1,7 @@ +{{name}}, +thanks for your message, we will get back to you shortly. +here your message for forther reference +{{message}} + +-- +{{sitename}} diff --git a/pandora/user/views.py b/pandora/user/views.py index bd46968da..207d4ac38 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -561,7 +561,14 @@ def contact(request): if request.user.is_authenticated() \ and 'receipt' in data \ 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: send_mail(subject.strip(), message, email_from, [email]) except: