sehmaschine/django-grappelli — pull request #440 by tdruez (2014-01-21 21:02:19+00:00)
Title: Fixed the Exception chains in autocomplete

Waring: This fix is incomplete.
The intention of "except KeyError" was to catch on the AUTOCOMPLETE_SEARCH_FIELDS access. Although, in the original code, this will never be reach, as the "except KeyError" is only catching on the "model.autocomplete_search_fields()".
This patch fix the first issue, although I'm not fan of nested exceptions.
Also, in the case neither of the autocomplete_search_fields() nor AUTOCOMPLETE_SEARCH_FIELDS was declared for the current lookup, the "search_fields = ()" assignment will make the QuerySet creation fail.
Therefore, I think this patch is incomplete and the logic of this method needs to be refactored.
Let me know what's your take on the issue. Thanks.