-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
15671 save module before sync_classes #15675
Conversation
Hi @arthanson, pardon me if this is a stupid question, but does def save(self, *args, **kwargs):
self.file_root = ManagedFileRootPathChoices.SCRIPTS
obj = super().save(*args, **kwargs)
self.sync_classes()
return obj |
Good catch, fixed. |
There are some other places in the NetBox code where
(in all likelihood not a complete list) |
Django's |
I would totally agree with you (I love consistency) if the convention in NetBox wouldn't seem to be to not return the value of
That's 6 "return" vs. 15 "don't return" - for models, I was mistaken about the forms, sorry. |
Fixes: #15671
save Module before doing sync_classes as it can cause M2M error:
ValueError: save() prohibited to prevent data loss due to unsaved related object 'module'.