diff --git a/framework/python/src/common/risk_profile.py b/framework/python/src/common/risk_profile.py index 4eca18b88..ab3251694 100644 --- a/framework/python/src/common/risk_profile.py +++ b/framework/python/src/common/risk_profile.py @@ -16,6 +16,9 @@ from dateutil.relativedelta import relativedelta from common import logger import json +import os + +PROFILES_PATH = 'local/risk_profiles' LOGGER = logger.get_logger('risk_profile') @@ -67,6 +70,10 @@ def update(self, profile_json, profile_format): self.questions = new_profile.questions self.status = new_profile.status + def get_file_path(self): + return os.path.join(PROFILES_PATH, + self.name + '.json') + def _validate(self, profile_json, profile_format): if self._valid(profile_json, profile_format): self.status = 'Expired' if self._expired() else 'Valid' @@ -229,7 +236,7 @@ def _expired(self): # Normalize the current date and time to midnight today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) - + # Check if the current date and time is past the expiry date return today > expiry_date