Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1111 closed defect (fixed)

Documentation Error in custom validator example

Reported by: afarnham@… Owned by: Jacob
Component: Documentation 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


From the documentation as it is at the time of this bug report:

from django.core import validators, formfields

class ContactManipulator(formfields.Manipulator):
    def __init__(self):
        self.fields = (
            # ... snip fields as above ...
            formfields.EmailField(field_name="to", validator_list=[self.isValidToAddress])

    def isValidToAddress(self, field_data, all_data):
        if not field_data.endswith(""):
            raise ValidationError("You can only send messages to e-mail addresses.")

Calls to ValidationError be written as such:

raise validators.ValidationError(...)

ValidationError by itself is undefined.

Change History (1)

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [1776]) Fixed #1111 -- Fixed bug in docs/forms.txt. Thanks, afarhham

Note: See TracTickets for help on using tickets.
Back to Top