Skip to content

Commit 589ebee

Browse files
committed
Not getting content cache key if it's not going to be used
1 parent 18b6d04 commit 589ebee

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

naucse/routes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,6 @@ def content_creator():
419419

420420
return {"content": content, "urls": relative_urls}
421421

422-
content_key = page_content_cache_key(Repo("."), lesson.slug, page.slug, solution, variables)
423-
424422
# only use the cache if there are no local changes and not rendering in fork
425423
if without_cache or is_dirty(Repo(".")):
426424
return content_creator()
@@ -429,6 +427,7 @@ def content_creator():
429427
# this is only dangerous if the fork sets absolute path to cache and
430428
# CurrentEnvironmentBackend or VenvBackend are used locally
431429
# FIXME? But I don't think there's a way to prevent writing to a file in those backends
430+
content_key = page_content_cache_key(Repo("."), lesson.slug, page.slug, solution, variables)
432431
cached = arca.region.get_or_create(content_key, content_creator)
433432

434433
# the urls are added twice to ``absolute_urls_to_freeze`` when the content is created

0 commit comments

Comments
 (0)