Skip to content

Commit 8078080

Browse files
committed
fix(action-network): remove space to get_field patterns in forms parse
1 parent 59254ee commit 8078080

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

action-network/web/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ def only_digits(field):
6565
else:
6666
return field
6767

68-
6968
def get_field(regex_pattern, fields):
7069
"""xxx"""
7170
pattern = re.compile(regex_pattern)
7271

73-
results = list(filter(lambda x: pattern.search(x['label'].lower()), fields))
74-
72+
results = list(filter(lambda x: pattern.search(x['label'].lower().strip()), fields))
73+
7574
if len(results) == 1 and 'value' in results[0]:
7675
return results[0]['value']
76+
elif len(results) == 2 and 'value' in results[0]:
77+
return results[0]['value']
7778

7879
return None

0 commit comments

Comments
 (0)