cvan/zamboni — comment on commit 82eb526fcce9fd05ac7af0373ccdc1c74b080959
File: apps/search/views.py line 581
By kumar303:

This is good enough for a hotfix but as a more permanent fix let's fix it at the source so other code using split_choices works as expected:

def split_choices(choices, split):
"""Split a list of [(key, title)] pairs after key == split."""
index = [idx for idx, (key, title) in enumerate(choices)
if key == split]
if index:
index = index[0] + 1
return list(choices[:index]), list(choices[index:])
else:
return list(choices), []