De-duplicate code in read_profile()

This commit is contained in:
Christian Boltz 2024-10-06 21:49:28 +02:00
parent 578ab8da9d
commit 2e8a75195c
Failed to generate hash of commit

View file

@ -1692,16 +1692,9 @@ def read_profile(file, active_profile, read_error_fatal=False):
if not attachment and profile.startswith('/'):
attachment = profile # use profile as name and attachment
if active_profile:
active_profiles.add_profile(filename, profile, attachment, profile_data[profile])
else:
for profile in profile_data:
attachment = profile_data[profile]['attachment']
filename = profile_data[profile]['filename']
if not attachment and profile.startswith('/'):
attachment = profile # use profile as name and attachment
extra_profiles.add_profile(filename, profile, attachment, profile_data[profile])