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

Jobs table is empty on Reports #14199

Closed
sleepinggenius2 opened this issue Nov 6, 2023 · 2 comments · Fixed by #14383
Closed

Jobs table is empty on Reports #14199

sleepinggenius2 opened this issue Nov 6, 2023 · 2 comments · Fixed by #14383
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@sleepinggenius2
Copy link
Contributor

NetBox version

v3.6.4

Python version

3.8

Steps to Reproduce

  1. Navigate to /extras/reports/
  2. Click on the name of a report
  3. Click on the "Jobs" tab

Expected Behavior

The number of rows in the table should match the number in the badge.

Observed Behavior

The table shows no rows, despite there being a number in the badge.

It looks like ReportJobsView has this line:

name=report.name

While ScriptJobsView has this line:

name=script.class_name

Changing ReportJobsView to have report.class_name instead of report.name seems to resolve this issue. Therefore, I suspect this might only be present on reports with a custom name set, but I am unable to test this at this time.

@sleepinggenius2 sleepinggenius2 added the type: bug A confirmed report of unexpected behavior in the application label Nov 6, 2023
@sleepinggenius2
Copy link
Contributor Author

I also noticed that the badge count is wrong and only takes into account the Object and not the Name, so all the reports within the same module show the same badge count on the Jobs tab. I believe that's an issue with the way that the JobsMixin class is implemented and how the jobs attribute is being used, so you get back a list of all the jobs for that module, but it is never filtered by name. There also seem to be a number of places in both the report and script code that the name and class_name attributes are used inconsistently.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Nov 29, 2023
@jeremystretch jeremystretch self-assigned this Nov 29, 2023
@jeremystretch
Copy link
Member

Changing ReportJobsView to have report.class_name instead of report.name seems to resolve this issue. Therefore, I suspect this might only be present on reports with a custom name set, but I am unable to test this at this time.

I've confirmed that this happens only for reports which have a custom named defined.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants