From 592cf3b31c676c647f50a27aab7f95389e0fd53d Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 21 Sep 2020 13:48:38 +0200 Subject: [PATCH] Added little note for potential performance improvement --- figures/sites.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/figures/sites.py b/figures/sites.py index d61b8a95..857fc2f1 100644 --- a/figures/sites.py +++ b/figures/sites.py @@ -136,6 +136,13 @@ def get_organizations_for_site(site): def get_course_keys_for_site(site): + """ + + Developer note: We could improve this function with caching + Question is which is the most efficient way to know cache expiry + + We may also be able to reduce the queries here to also improve performance + """ if figures.helpers.is_multisite(): orgs = organizations.models.Organization.objects.filter(sites__in=[site]) org_courses = organizations.models.OrganizationCourse.objects.filter(