torchbox / wagtail-grapple

A Wagtail app that makes building GraphQL endpoints a breeze!
https://wagtail-grapple.readthedocs.io/en/latest/
Other
151 stars 57 forks source link

Avoid using hardcoded localhost in Redirects #380

Closed JakubMastalerz closed 6 months ago

JakubMastalerz commented 6 months ago

This PR changes old_url handling in RedirectType to replace hardcoded URL generation with dynamically generated URLs based on wagtail's sites properties.

Additionally:

The changes were tested for performance and did not increase the number of queries when querying Redirects.

kbayliss commented 6 months ago

@JakubMastalerz this is looking GREAT! As discussed earlier, can you review the performance of these changes to check we're not adversely affecting performance? In particular, I'm interested in the number of queries being made to ensure we're not causing any N+1 queries.