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

Fix PEP8

parent 53b0ea31
Pipeline #995 failed with stage
in 10 minutes and 38 seconds
import unicodedata
def strip_accents(value):
return ''.join(c for c in unicodedata.normalize('NFD', value)
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_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})
data = json.dumps(json_results)
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