From 615cad4b4908cbb3a8bbbbec789c2d4213705421 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 1 Oct 2013 20:01:38 +0200 Subject: [PATCH] EmailOption and URLOption : let user choose attr for DomainnameOption --- tiramisu/option.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tiramisu/option.py b/tiramisu/option.py index 0d0c69a..88da41a 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -1039,12 +1039,6 @@ class EmailOption(DomainnameOption): _opt_type = 'email' username_re = re.compile(r"^[\w!#$%&'*+\-/=?^`{|}~.]+$") - def __init__(self, *args, **kwargs): - kwargs['type_'] = 'domainname' - kwargs['allow_ip'] = False - kwargs['allow_without_dot'] = False - super(EmailOption, self).__init__(*args, **kwargs) - def _validate(self, value): splitted = value.split('@', 1) try: @@ -1063,12 +1057,6 @@ class URLOption(DomainnameOption): proto_re = re.compile(r'(http|https)://') path_re = re.compile(r"^[a-z0-9\-\._~:/\?#\[\]@!%\$&\'\(\)\*\+,;=]+$") - def __init__(self, *args, **kwargs): - kwargs['type_'] = 'domainname' - kwargs['allow_ip'] = False - kwargs['allow_without_dot'] = False - super(URLOption, self).__init__(*args, **kwargs) - def _validate(self, value): match = self.proto_re.search(value) if not match: