Make cache compatible with encrypted settings

This saves the id value of the setting into the cache
if the setting is encrypted. That can then be combined
with the secret_key in order to decrypt the setting,
without having to make an additional query to the database.
This commit is contained in:
AlanCoding
2017-08-17 17:18:41 -04:00
parent 32fea6ef19
commit 9254bcaf16
3 changed files with 37 additions and 2 deletions

View File

@@ -74,6 +74,10 @@ class Setting(CreatedModifiedModel):
def get_cache_key(self, key):
return key
@classmethod
def get_cache_id_key(self, key):
return '{}_ID'.format(key)
import awx.conf.signals # noqa