Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions framework/python/src/common/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,14 @@ def update_profile(self, profile_json):

else:

old_name = risk_profile.name

risk_profile.update(profile_json, self._profile_format)
# Check if name has changed
if 'rename' in profile_json:
# Delete the original file
os.remove(os.path.join(PROFILES_DIR, risk_profile.name + '.json'))

# Find the index of the risk_profile to replace
index_to_replace = next(
(index for (index, d) in enumerate(
self._profiles) if d.name == profile_name), None)

if index_to_replace is not None:
self._profiles[index_to_replace] = risk_profile
# Delete the original file
os.remove(os.path.join(PROFILES_DIR, old_name + '.json'))

# Write file to disk
with open(
Expand Down
1 change: 0 additions & 1 deletion local/risk_profiles/Primary profile.json

This file was deleted.