Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#734 closed defect (fixed)

isValidIPAddress4 uses wrong ValidationError object

Reported by: hugo Owned by: adrian
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: UI/UX:

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.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1091]) Fixed #734 -- Fixed namespace bug in validators.isValidIPAddress4. Thanks, Hugo and mflanagan

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.