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

Backtrace when adding an invalid IP address with ENFORCE_GLOBAL_UNIQUE #810

Closed
candlerb opened this issue Jan 18, 2017 · 0 comments
Closed
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@candlerb
Copy link
Contributor

This is with netbox 1.8.1

  • Set ENFORCE_GLOBAL_UNIQUE to True
  • Go to page to add a new IP address: /ipam/ip-addresses/add/
  • Enter an invalid or incomplete address e.g. 1.2.3 or 1.2.3.4 (not 1.2.3.4/32)
  • Click "Add"

Instead of a data validation error, I get an exception:

'unicode' object has no attribute 'ip'

With DEBUG=True, I get a backtrace which ends at:

...
/usr/local/lib/python2.7/dist-packages/django/forms/models.py in _post_clean
            self.instance.full_clean(exclude=exclude, validate_unique=False) ...
> Local vars
/usr/local/lib/python2.7/dist-packages/django/db/models/base.py in full_clean
            self.clean() ...
> Local vars
/opt/netbox/netbox/ipam/models.py in clean
            duplicate_ips = IPAddress.objects.filter(vrf=None, address__net_host=str(self.address.ip))\ ...
> Local vars
  Variable    Value
  self        <IPAddress: >
@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Jan 18, 2017
lampwins pushed a commit to lampwins/netbox that referenced this issue Oct 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants