Skip to content

Fix #2414: Add ExcludeModel to export and fix missing excludes list#2431

Open
abubakarsabir924-cell wants to merge 4 commits intoborgbase:masterfrom
abubakarsabir924-cell:fix-excludes-export-2414
Open

Fix #2414: Add ExcludeModel to export and fix missing excludes list#2431
abubakarsabir924-cell wants to merge 4 commits intoborgbase:masterfrom
abubakarsabir924-cell:fix-excludes-export-2414

Conversation

@abubakarsabir924-cell
Copy link

@abubakarsabir924-cell abubakarsabir924-cell commented Mar 15, 2026

Description

Summary
This PR fixes issue #2414 where the excludes list was missing in exported settings.
Changes
Added ExcludeModel to profile_export.py
Ensured excludes list is properly included in export
Fixed related import issues
Testing
Verified that excludes list is now included in exported settings
Tested export functionality to ensure no regressions
Notes
This PR is now ready for review. Feedback is highly appreciated.

Related Issue

Motivation and Context

How Has This Been Tested?

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.

@abubakarsabir924-cell
Copy link
Author

I've updated the code.
Added ExcludeModel to profile_export.py and fixed the imports. Ready for review!

@abubakarsabir924-cell abubakarsabir924-cell marked this pull request as ready for review March 15, 2026 20:15
@abubakarsabir924-cell
Copy link
Author

Hi @m3nu sir, just a gentle reminder about my PR. I would really appreciate your feedback. The application deadline is approaching, so your guidance would really help me improve. Thank you!

@abubakarsabir924-cell abubakarsabir924-cell changed the title WIP:Working on excludes list export bug #2414 Fix #2414: Add ExcludeModel to export and fix missing excludes list Mar 17, 2026
@m3nu
Copy link
Contributor

m3nu commented Mar 19, 2026

Code review

Found 1 issue:

  1. Missing to_db import-side handling for exclusions. The PR adds ExcludeModel serialization in from_db(), but to_db() has no corresponding logic to restore exclusion records on profile import. Every other model exported in from_db has a matching block in to_db that (a) sets the profile FK, (b) deletes existing rows, (c) bulk-inserts, and (d) removes the key from _profile_dict before dict_to_model(). Without this, exported exclusions are silently dropped on import, and the leftover key in the dict may interfere with dict_to_model(BackupProfileModel, ...). See the SourceFileModel pattern for reference.

for source in SourceFileModel.select().where(SourceFileModel.profile == profile)
]
# Add ExcludeModel
profile_dict['ExcludeModel']=[
model_to_dict(exclude, recurse=False, exclude=[ExcludeModel.id])
for exclude in ExcludeModel.select().where(ExcludeModel.profile == profile)

Also note: the model class is named ExclusionModel (not ExcludeModel) in src/vorta/store/models.py:172.

@abubakarsabir924-cell
Copy link
Author

Thanks for the detailed review, @m3nu sir
I see the issue with the missing to_db() logic and the model name. I'm working on the fix now and will update the PR shortly

@m3nu
Copy link
Contributor

m3nu commented Mar 19, 2026

You're lucky #2434 has just as many issues. I also don't understand how you produce such basic errors with AI, tests and linters. All of those should have caught them.

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.

2 participants