Changes between Version 7 and Version 8 of CustomFormFields


Ignore:
Timestamp:
Dec 23, 2009, 1:41:08 AM (15 years ago)
Author:
bugmenot
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CustomFormFields

    v7 v8  
    7171                    except ValueError:
    7272                        raise validators.ValidationError, _("Port number must be between 1 and 65355")
    73                     if proto.lower().strip() not in ['tcp', 'udp']:
     73                    if proto.lower().strip() not in ('tcp', 'udp'):
    7474                        raise validators.ValidationError, _("Protocol must be either 'TCP' or 'UDP'")
    7575
     
    9999    def convert_post_data(self, new_data):
    100100        name = self.get_member_name()
    101         if new_data.has_key(self.field_name):
     101        if self.field_name in new_data:
    102102            d = new_data.getlist(self.field_name)
    103103            try:
     
    150150                except ValueError:
    151151                    raise validators.ValidationError, _("Port number must be between 1 and 65355")
    152                 if proto.lower().strip() not in ['tcp', 'udp']:
     152                if proto.lower().strip() not in ('tcp', 'udp'):
    153153                    raise validators.ValidationError, _("Protocol must be either 'TCP' or 'UDP'")
    154154
Back to Top