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

FieldError when sorting VMs list by primary IP #3503

Closed
jakubkrysl opened this issue Mar 28, 2023 · 2 comments · Fixed by #3777
Closed

FieldError when sorting VMs list by primary IP #3503

jakubkrysl opened this issue Mar 28, 2023 · 2 comments · Fixed by #3777
Assignees
Labels
type: bug Something isn't working as expected

Comments

@jakubkrysl
Copy link

Environment

  • Nautobot version (Docker tag too if applicable): 1.5.7
  • Python version: 3.7.16
  • Database platform, version:
  • Middleware(s):

Steps to Reproduce

  1. Sort VirtualMachines by primary IP column
    https://demo.nautobot.com/virtualization/virtual-machines/?sort=primary_ip

Expected Behavior

VMs sorted by primary IP

Observed Behavior

image

@david-kn
Copy link
Contributor

It works for other model(s) e.g. devices though: https://demo.nautobot.com/dcim/devices/?sort=primary_ip
So it's some funny inner bug in relationships probably...

@glennmatthews
Copy link
Contributor

glennmatthews commented Mar 28, 2023

Thanks for the report and for the context!

DeviceTable has primary_ip = tables.Column(linkify=True, order_by=("primary_ip6", "primary_ip4"), verbose_name="IP Address") while VirtualMachineDetailTable has just primary_ip = tables.Column(linkify=True, verbose_name="IP Address"). Probably adding the missing order_by to the latter would be sufficient to fix this.

@glennmatthews glennmatthews added the type: bug Something isn't working as expected label Mar 28, 2023
@timizuoebideri1 timizuoebideri1 self-assigned this May 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2023
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
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants