Changeset - 813446c568bd
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 7 months ago 2023-10-26 02:09:50
ben@sturm.com.au
Remove CONSERVANCY_SECRET_KEY

Use SECRET_KEY instead to minimise use of non-standard settings.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy/__init__.py
Show inline comments
...
 
@@ -6,13 +6,13 @@ from django.conf import settings
 
class ParameterValidator:
 
    def __init__(self, given_hash_or_params, params_hash_key=None):
 
        if params_hash_key is None:
 
            self.given_hash = given_hash_or_params
 
        else:
 
            self.given_hash = given_hash_or_params.get(params_hash_key)
 
        seed = getattr(settings, 'CONSERVANCY_SECRET_KEY', '').encode('utf-8')
 
        seed = settings.SECRET_KEY.encode('utf-8')
 
        self.hasher = hashlib.sha256(seed)
 
        if isinstance(self.given_hash, str):
 
            self.hash_type = type(self.given_hash)
 
        else:
 
            self.hash_type = type(self.hasher.hexdigest())
 
        self.valid = None
0 comments (0 inline, 0 general)