Typeahead: Fix ValueError introduced in b3436c1

Fix PRETIXEU-14A
This commit is contained in:
Raphael Michel
2019-06-03 09:57:35 +02:00
parent ae71492902
commit f25bb571b9

View File

@@ -150,7 +150,9 @@ def nav_context_list(request):
if show_user and organizer:
organizer = serialize_orga(Organizer.objects.get(pk=organizer))
results.insert(1, results.pop(results.index(organizer)) if results.index(organizer) else organizer)
if organizer in results:
results.remove(organizer)
results.insert(1, organizer)
doc = {
'results': results,