Skip to content

Commit 5a7f6f1

Browse files
committed
fix cache id reporting
1 parent 1f8efac commit 5a7f6f1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

website/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def community_projects():
4949
community_projects_cache = [
5050
{"project_id":p.id, "title":p.title, "author":p.author_name, "thumbnail_url":f"https://uploads.scratch.mit.edu/get_image/project/{p.id}_480x360.png"} for p in projects
5151
]
52-
cache.set("community_projects", {"value": community_projects_cache, "data_id": secrets.token_urlsafe(32)}, {"ttl": 300, "tags": ["website"]})
52+
community_projects_cache_data = {"value": community_projects_cache, "data_id": secrets.token_urlsafe(32)}
53+
cache.set("community_projects", community_projects_cache_data, {"ttl": 300, "tags": ["website"]})
5354
response = jsonify(random.choices(community_projects_cache, k=5))
5455
response.headers.add("Fetched-Data-Id", community_projects_cache_data and community_projects_cache_data.get("data_id"))
5556
return response

0 commit comments

Comments
 (0)