We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59254ee commit 8078080Copy full SHA for 8078080
action-network/web/utils.py
@@ -65,14 +65,15 @@ def only_digits(field):
65
else:
66
return field
67
68
-
69
def get_field(regex_pattern, fields):
70
"""xxx"""
71
pattern = re.compile(regex_pattern)
72
73
- results = list(filter(lambda x: pattern.search(x['label'].lower()), fields))
74
+ results = list(filter(lambda x: pattern.search(x['label'].lower().strip()), fields))
+
75
if len(results) == 1 and 'value' in results[0]:
76
return results[0]['value']
+ elif len(results) == 2 and 'value' in results[0]:
77
+ return results[0]['value']
78
79
return None
0 commit comments