wagtail / wagtailtrans

A Wagtail add-on for supporting multilingual sites
http://wagtailtrans.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

Wagtail deprecated request.site #194

Closed joaquinstirling closed 3 years ago

joaquinstirling commented 4 years ago

as the log says "Please update your code to use Site.find_for_request(request) in place of request.site."

I'm making this change because I had to create my own middleware inside my app to get wagtailtrans running. this will fix the issues and have support for the future Wagtail versions.

related: Issue #185

Vadim-Karpenko commented 4 years ago

I think you forgot to import the Site object, could you please take a look? from wagtail.core.models import Site

jjanssen commented 3 years ago

Thanks for taking the effort to create a PR for this. As we're also taking backwards compatibility into account we made a release this week which applies these changes, as well as having it compatible with codebases that still have the SiteMiddleware implemented until Wagtail 2.11.