mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 16:52:16 +00:00
Detect redriect when getting docs content from db cache
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user