Skip to content

Commit

Permalink
delete existing sources on profile overwrite borgbase#1942
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLazron committed Mar 6, 2024
1 parent b2cf5b1 commit baf07a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vorta/profile_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def to_db(self, overwrite_profile=False, overwrite_settings=True):
# Set the profile ids to be match new profile
for source in self._profile_dict['SourceFileModel']:
source['profile'] = self.id
for source in SourceFileModel.select().where(SourceFileModel.profile == source['profile']):
SourceFileModel.delete_by_id(source)
SourceFileModel.insert_many(self._profile_dict['SourceFileModel']).execute()

# Delete added dictionaries to make it match BackupProfileModel
Expand Down

0 comments on commit baf07a5

Please sign in to comment.