File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ def start_flow():
65
65
# components.
66
66
# 6. Update each row in pdp_contacts to give it a match id
67
67
# corresponding to its connected componenet.
68
-
69
68
70
69
current_app .logger .info ("Clearing pdp_contacts to prepare for match" )
71
70
reset_pdp_contacts_with_unmatched (conn )
@@ -113,9 +112,17 @@ def reset_pdp_contacts_with_unmatched(conn):
113
112
conn .execute (Volgistics .insert_into_pdp_contacts ())
114
113
conn .execute (ShelterluvPeople .insert_into_pdp_contacts ())
115
114
116
- def compare_names (n1 , n2 ):
115
+
116
+ def name_to_array (n ):
117
117
delims = text ("'( and | & |, | )'" )
118
- return func .regexp_split_to_array (func .lower (n1 ), delims ).bool_op ("&&" )(func .regexp_split_to_array (func .lower (n2 ), delims ))
118
+ return func .regexp_split_to_array (
119
+ func .lower (func .translate (n , text ("'\" '" ), text ("''" ))), delims
120
+ )
121
+
122
+
123
+ def compare_names (n1 , n2 ):
124
+ return name_to_array (n1 ).bool_op ("&&" )(name_to_array (n2 ))
125
+
119
126
120
127
def get_automatic_matches (conn ):
121
128
pc1 = PdpContacts .__table__ .alias ()
You can’t perform that action at this time.
0 commit comments