Yes, passing the site seems like a better option. We are indeed hitting
exactly the problem we have hopefully avoided with the class-based
views, but can't solve in the same way here due to backwards
compatibility.
> 2. FlatPageSitemap.items() uses it... however, flatpages is directly
> coupled to the sites framework with an M2M field, so the better way to
> do this is to filter the FlatPage objects based on the current site.
> You'd never even get to the point of items() being called if you don't
> have contrib.sites installed so protecting against not having it is
> useless.
Yes - a RequestSite cannot have a 'flatpages_set' attribute, so there is
no need for FlatPageSitemap.items to be given a request or a RequestSite
object.
There is still the problem that the current site (or request) is not
available to the Sitemap.items() method, or the Sitemap.paginator
property, which some people might want. We can't fix this without a lot
of ugliness, like ignoring the paginator property for a start, so I'm
going to commit your fix as it is.
Thanks.
Luke
--
"God demonstrates his love towards us in this, that while we were
still sinners, Christ died for us." (Romans 5:8)
Luke Plant || http://lukeplant.me.uk/