Detect redriect when getting docs content from db cache

This commit is contained in:
Greg Kaleka
2025-09-12 15:09:13 -04:00
parent adc3804bf7
commit 7fe8614db7

View File

@@ -348,10 +348,16 @@ class BaseStaticContentTemplateView(TemplateView):
content_obj = RenderedContent.objects.filter(modified__gte=start_time).get(
cache_key=cache_key
)
return {
result = {
"content": content_obj.content_html,
"content_type": content_obj.content_type,
}
if content_obj.content_type.startswith("text/html"):
result["redirect"] = get_meta_redirect_from_html(
content_obj.content_html
)
return result
except RenderedContent.DoesNotExist:
return None