File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ def load_policy_if_needed(cls):
170170 last_version = PolicyCacheControl .get_version ()
171171
172172 if last_version is None :
173- # No timestamp in cache; initialize it
173+ # No version in cache control ; initialize it
174174 last_version = uuid4 ()
175175 PolicyCacheControl .set_version (last_version )
176176 logger .info ("Initialized policy last modified version in cache control." )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class PolicyCacheControl(models.Model):
1111 This model can be used to trigger cache invalidation for authorization policies
1212 by changing the version. Whenever this model is updated, the authorization
1313 engine should invalidate its cached policies.
14+
15+ .. no_pii:
1416 """
1517
1618 version = models .UUIDField (default = uuid4 )
Original file line number Diff line number Diff line change @@ -836,8 +836,8 @@ class TestEnforcerPolicyCacheBehavior(TransactionTestCase):
836836
837837 @patch ("openedx_authz.engine.enforcer.libraries_v2_enabled" )
838838 @override_settings (CASBIN_AUTO_LOAD_POLICY_INTERVAL = 0 )
839- def test_load_policy_if_needed_initializes_cache_timestamp (self , mock_toggle ):
840- """Test that load_policy_if_needed initializes cache timestamp on first call.
839+ def test_load_policy_if_needed_initializes_cache_version (self , mock_toggle ):
840+ """Test that load_policy_if_needed initializes cache version on first call.
841841
842842 Expected result:
843843 - On first call, cache invalidation model is initialized
You can’t perform that action at this time.
0 commit comments