Skip to content

Remove duplicate sources on profile import#2017

Merged
m3nu merged 2 commits intoborgbase:masterfrom
shivansh02:issue1942
Jul 1, 2024
Merged

Remove duplicate sources on profile import#2017
m3nu merged 2 commits intoborgbase:masterfrom
shivansh02:issue1942

Conversation

@shivansh02
Copy link
Collaborator

Description

Removes duplicate source files when importing an existing profile and choosing to overwrite. Based on PR by @TheLazron .

Related Issue

Fixes #1942

Motivation and Context

How Has This Been Tested?

Tested locally.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

for source in self._profile_dict['SourceFileModel']:
source['profile'] = self.id
# Delete existing Sources to avoid duplicates
for source in SourceFileModel.select().where(SourceFileModel.profile == self.id):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shivansh02 shivansh02 requested a review from m3nu June 9, 2024 11:47
@m3nu m3nu merged commit 22a21f0 into borgbase:master Jul 1, 2024
@szpak
Copy link

szpak commented Jul 1, 2024

Thanks, I will give it a try, once released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated "source folders" on export and import of the same profile

3 participants