Open robmoorman opened 4 years ago
@gasman This is serious
Would like to give this a try.
@gasman @disconnect821 I'm on it
The documentation does mention that the get_queryset
function is a customisation point for the IndexView
and makes no mention that the same queryset is used for other views: https://docs.wagtail.org/en/stable/reference/contrib/modeladmin/indexview.html#modeladmin-get-queryset
Changing this behaviour might be unexpected (although unlikely) for existing users. That said, I'm inclined to classify this as an enhancement request rather than a bug.
As per wagtail/rfcs#85, I'm moving this to the wagtail-modeladmin repo. I believe the same is also the case with snippets, so I'll file a separate issue for that.
It's common to use a filtered set of models in order to apply view restrictions on list views, e.g.
Issue
File wagtail/contrib/modeladmin/options.py
Example override:
If you try to change the id of an edit url (which shouldn't be allowed) you can still enter the details of that object. From my point of view it's caused by this piece of code:
Possible solution
The id/pk should be filtered from the
get_queryset
instead and respect it possible overrides.