-
Notifications
You must be signed in to change notification settings - Fork 356
Fixes inability to define the field_order in jobs. #467
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
Conversation
glennmatthews
left a comment
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 like a good and straightforward fix/enhancement - thank you!
Since _commit is automatically added to the form fields, the job author may not think to include it in field_order - when we call order_fields, what happens to fields that aren't in the list, do they get sent to the start or the end of the form?
It would be nice to add a quick test or two for as_form() with and without a specified field_order, if you're up for doing that.
|
Per Django Docs, anything not provided by field_order would be appended to the bottom per the default order that Django would decide. https://docs.djangoproject.com/en/3.2/ref/forms/api/#django.forms.Form.field_order I will see what I can do about tests. |
Co-authored-by: Glenn Matthews <[email protected]>
Co-authored-by: Glenn Matthews <[email protected]>
…correct_job_order
# Conflicts: # nautobot/docs/release-notes/version-1.0.md
glennmatthews
left a comment
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.
Thank you!
Co-authored-by: Glenn Matthews <[email protected]>
# Conflicts: # nautobot/docs/release-notes/version-1.0.md
Fixes: #459
Fixes the field_order Meta option to jobs.
I can add tests for these, I noticed none of the tests for Jobs tested any of the optional attributes (Name, Description, Commit_Default). We might want to make that a followup ticket...