#734 closed defect (fixed)
isValidIPAddress4 uses wrong ValidationError object
| Reported by: | hugo | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Validators | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The isValidIPAddress4 uses validators.ValidationError instead of just ValidationError and so throws this traceback:
There's been an error:
Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/handlers/base.py", line 71, in get_response
response = callback(request, **param_dict)
File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/contrib/admin/views/decorators.py", line 49, in _checklogin
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/contrib/admin/views/main.py", line 878, in change_stage
errors = manipulator.get_validation_errors(new_data)
File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/formfields.py", line 70, in get_validation_errors
validator(new_data.get(field.field_name, ''), new_data)
File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/formfields.py", line 695, in isValidIPAddress
validators.isValidIPAddress4(field_data, all_data)
File "/usr/local/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/validators.py", line 99, in isValidIPAddress4
raise validators.ValidationError, "Please enter a valid IP address."
NameError: global name 'validators' is not defined
This was reported on IRC by mflanagan.
Note:
See TracTickets
for help on using tickets.
(In [1091]) Fixed #734 -- Fixed namespace bug in validators.isValidIPAddress4. Thanks, Hugo and mflanagan