omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

Add setting to fine-tune admin search fields #1035

Closed atugushev closed 7 years ago

atugushev commented 7 years ago

One day i needed to configure search fields of UserSocialAuth like this:

search_fields = ['=userid', '^useremail', '=uid']

I found the setting _ADMIN_USER_SEARCHFIELDS, but it was very limited. It does not allow to do restrictive searches, using by prefix the field name with an operator.

Also, since the setting has related to User model, you can't search by the other models fields.

I've added new setting ADMIN_SEARCH_FIELDS. Please, review!

omab commented 7 years ago

I've ported this PR into social-app-django.

Thanks!