Ticket #7807: oldforms-length.patch

File oldforms-length.patch, 761 bytes (added by masneyb@…, 16 years ago)
  • oldforms/__init__.py

    old new  
    381381    def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=None, member_name=None):
    382382        if validator_list is None: validator_list = []
    383383        self.field_name = field_name
    384         self.length, self.maxlength = length, maxlength
     384
     385        if (length > maxlength):
     386            self.length, self.maxlength = maxlength, maxlength
     387        else:
     388            self.length, self.maxlength = length, maxlength
     389
    385390        self.is_required = is_required
    386391        self.validator_list = [self.isValidLength, self.hasNoNewlines] + validator_list
    387392        if member_name != None:
Back to Top