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

Error when searching for IP without prefix #286

Closed
jakubkrysl opened this issue Apr 12, 2021 · 2 comments · Fixed by #281
Closed

Error when searching for IP without prefix #286

jakubkrysl opened this issue Apr 12, 2021 · 2 comments · Fixed by #281
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@jakubkrysl
Copy link

Environment

  • Python version: 3.8.5
  • Nautobot version: 1.0.0b3

When I use search field in the top right most corner (in navbar nex to user) and I search only by IP without prefix, I get the following error:
image

Full trace:

Traceback (most recent call last):
  File "/opt/nautobot/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/nautobot/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/nautobot/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/nautobot/lib/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/views/__init__.py", line 159, in get
    filtered_queryset = filterset({"q": form.cleaned_data["q"]}, queryset=queryset).qs
  File "/opt/nautobot/lib/python3.8/site-packages/django_filters/filterset.py", line 243, in qs
    qs = self.filter_queryset(qs)
  File "/opt/nautobot/lib/python3.8/site-packages/django_filters/filterset.py", line 230, in filter_queryset
    queryset = self.filters[name].filter(queryset, value)
  File "/opt/nautobot/lib/python3.8/site-packages/django_filters/filters.py", line 779, in __call__
    return self.method(qs, self.f.field_name, value)
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot/ipam/filters.py", line 183, in search
    broadcast__gte=bytes(query.broadcast),

Exception Type: TypeError at /search/
Exception Value: cannot convert 'NoneType' object to bytes

Searching with prefix works:
image

Steps to Reproduce

  1. Search IP without prefix in the navbar box
    image

Expected Behavior

IP searched, results showed

Observed Behavior

TypeError

@jathanism
Copy link
Contributor

@Thetacz Thanks for the report. Looks like this will also be fixed by #281

@jathanism jathanism added the type: bug Something isn't working as expected label Apr 12, 2021
@jathanism jathanism self-assigned this Apr 12, 2021
@jathanism jathanism added this to the v1.0.0 milestone Apr 12, 2021
@jathanism jathanism added this to To do in Release v1.0.0 via automation Apr 12, 2021
@jathanism jathanism moved this from To do to In progress in Release v1.0.0 Apr 12, 2021
@jathanism
Copy link
Contributor

jathanism commented Apr 12, 2021

Search_-_Nautobot

Release v1.0.0 automation moved this from In progress to Done Apr 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2021
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
Development

Successfully merging a pull request may close this issue.

3 participants