Merge pull request #2935 from matmair/fix-anon-static

fix error with anon connections and language check
This commit is contained in:
Oliver 2022-05-06 09:16:57 +10:00 committed by GitHub
commit eb1aad71ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -548,7 +548,8 @@ class I18nStaticNode(StaticNode):
# Store the original (un-rendered) path template, as it gets overwritten below
self.original = self.path.var
self.path.var = self.original.format(lng=context.request.LANGUAGE_CODE)
if hasattr(context, 'request'):
self.path.var = self.original.format(lng=context.request.LANGUAGE_CODE)
ret = super().render(context)