-
Notifications
You must be signed in to change notification settings - Fork 34
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
Remove status attribute requirement when state is present #298
Conversation
Thoughts on validating when |
You missed one in the device_interface module. |
If I understand correctly, this would mean updating this check for all required fields not just status. With the change in this PR, if you attempt to create a record without a required status field this is the result, which I think is pretty clear.
|
Honestly, looking at the code closer I think we should remove every |
I agree that it makes sense to remove it in most cases. There are some I'm not so sure about, however. Locations for example require an id if the state is absent, which I assume is to prevent deleting multiple locations with the same name. |
Good catch, yes. |
I guess I should have clarified, I don't think we need any |
PR updated to remove all references to required_if state is present |
Looks good to me, I thought possibly it would be a python traceback. The message provided is good. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
Closes #251
Remove the
status
field requirement when state ispresent
. This should eliminate the need to provide a status when updating non-status fields on an existing record.