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

Cannot access JobResult id via call to ObjectVar #989

Closed
grelleum opened this issue Oct 10, 2021 · 0 comments · Fixed by #990
Closed

Cannot access JobResult id via call to ObjectVar #989

grelleum opened this issue Oct 10, 2021 · 0 comments · Fixed by #990
Labels
type: bug Something isn't working as expected

Comments

@grelleum
Copy link
Contributor

Environment

  • Python version: 3.6
  • Nautobot version: 1.14

Steps to Reproduce

  1. Create a class that inherits from nautobot.extras.jobs.Job
  2. selection = ObjectVar(model=JobResult, display_field="id")
  3. Navigate to the page to add a job instance.

Expected Behavior

Should see a the available job IDs to select one.

Observed Behavior

No Job IDs are displayed.

Additional Information

I spoke with @glennmatthews regarding this issue and he has determined the root cause is that ObjectVar performs an API request with brief=True and the brief request always goes through the Nested Serializer. In this case the NestedJobResultSerializer is missing the id and name fields.

@glennmatthews glennmatthews added the type: bug Something isn't working as expected label Oct 12, 2021
glennmatthews added a commit that referenced this issue Oct 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants