Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always handle autosave setting when saving SettingsModel (fixes #1092) #1093

Merged
merged 2 commits into from
Nov 2, 2021
Merged

Conversation

phihos
Copy link
Contributor

@phihos phihos commented Nov 1, 2021

Fixes #1092 - This PR attempts to fix the autostart setting not being set correctly when importing. I deliberately chose not to duplicate the code from the misc tab to the init_db function. Instead I tried to keep it DRY and use signals from Pewee. This has the advantage that is does not matter where the SettingsModel is saved - the autostart is always set up afterwards.
This is only a suggestion how to fix it and I know that this is a bit different from an architectural point of view. We basically pull logic from a view to the models. I am always open to a different approach.

@m3nu m3nu merged commit fba6a2f into borgbase:master Nov 2, 2021
@m3nu
Copy link
Contributor

m3nu commented Nov 2, 2021

Looks fine. Maybe we will find other uses for Peewee Signals.

https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#connecting-handlers

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.

Autostart setting not set after importing settings from .vorta-init.json
2 participants