question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django Admin Search FILTER_ERROR

See original GitHub issue

When using django-ldapdb and using the search form in the admin page, a FILTER_ERROR occurs.

Search Fields defined in admin.py:

class LdapGroupAdmin(admin.ModelAdmin):
    exclude = ['dn', 'password', 'photo']
    list_display = ['cn', 'gidNumber', 'mumberUid']
    search_fields = ['gidNumber',]

admin.site.register(models.LdapGroup, LdapGroupAdmin)

The following error occurs:

FILTER_ERROR at /ldapdb/admin/ldapapi/ldapgroup/
{'desc': u'Bad search filter'}

The search filter being sent to pyldap appears to be:

'(&(objectClass=top)(objectClass=posixGroup)(ldapapi_ldapgroup.gidNumber LIKE %959959%))',

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rbarroiscommented, Jun 25, 2018

Issue cleaning: I’m closing this one (no activity for 1+ year), feel free to reopen it if you still have issues!

0reactions
peppelinuxcommented, Jul 7, 2018

Fixed in https://github.com/django-ldapdb/django-ldapdb/pull/152

in ldapdb/models/fields.py we should register IContains to ListField (and MultiValueField too):

ListField.register_lookup(IContainsLookup)

Fixed, it works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django Admin Filter and Search Fields Not Working
I want to be able to add new Author and Narrator objects and search through these fields. This stopped working after the form...
Read more >
How to filter and search on the Django admin page
The Django admin page is very useful if you are looking to search or filter the various aspects of your project. For large-scale...
Read more >
Doing text lookup for a ModelChoiceField on Admin gets ...
Needed to change the search_fields using a custom get_search_results and also use the other fields/list results #admin.py class SomeModelAdmin(admin.
Read more >
shinneider/django-admin-search: Modal filter for ...
The "Django Admin Search" is a advanced search modal for django admin. If you use or like the project, click Star and Watch...
Read more >
ModelAdmin List Filters
A 2-tuple containing a field name and a subclass of django.contrib.admin. ... Field names in list_filter can also span relations using the __...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found