Commit a11eceb7 authored by alexandre.jauneau's avatar alexandre.jauneau

Fix PEP8

parent 53b0ea31
import unicodedata
def strip_accents(value):
return ''.join(c for c in unicodedata.normalize('NFD', value)
if unicodedata.category(c) != 'Mn')
return ''.join(
c for c in unicodedata.normalize('NFD', value)
if unicodedata.category(c) != 'Mn')
......@@ -4,6 +4,7 @@ from haystack.query import SearchQuerySet
from django.core.urlresolvers import reverse
from memopol.utils import strip_accents
def search_autocomplete(request):
if request.is_ajax():
q = strip_accents(request.GET.get('term', ''))
......@@ -15,7 +16,8 @@ def search_autocomplete(request):
result_json['id'] = result.id
result_json['label'] = result.full_name
result_json['value'] = result.full_name
result_json['link'] = reverse('representative-detail', kwargs={'slug': result.slug})
result_json['link'] = reverse(
'representative-detail', kwargs={'slug': result.slug})
json_results.append(result_json)
data = json.dumps(json_results)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment