#27356: admin lookup_allowed returns False for a filter which is in list_filter
-------------------------------+--------------------
     Reporter:  Tobias Krönke  |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  contrib.admin  |    Version:  1.10
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Assume these 3 models in an app called `foo`:

 {{{#!python
 class Somebody(models.Model):
     user = models.OneToOneField(AUTH_USER_MODEL)

 class Profile(models.Model):  # we want an admin for this and filter on
 related data!
     who = models.OneToOneField(Somebody)

 class ClientInfo(models.Model):
     who = models.OneToOneField(Somebody)
     filter_by_me_please = models.CharField(db_index=True, max_length=20,
 blank=True)
 }}}

 and this profile admin:

 {{{#!python
 class ProfileAdmin(admin.ModelAdmin):
     list_filter = ('who__clientinfo__filter_by_me_please', )

 admin.site.register(Profile, ProfileAdmin)
 }}}

 I get this error
 {{{
 DisallowedModelAdminLookup at /admin/foo/profile/
 Filtering by who__clientinfo__filter_by_me_please not allowed
 }}}
 on opening
 
http://localhost:8000/admin/foo/profile/?who__clientinfo__filter_by_me_please=yay

 The 3 lookup levels seem to be important to reproduce this.

--
Ticket URL: <https://code.djangoproject.com/ticket/27356>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/047.07e77d679cae53e86f4fb443153589a2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to