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():
6565 # components.
6666 # 6. Update each row in pdp_contacts to give it a match id
6767 # corresponding to its connected componenet.
68-
6968
7069 current_app .logger .info ("Clearing pdp_contacts to prepare for match" )
7170 reset_pdp_contacts_with_unmatched (conn )
@@ -113,9 +112,17 @@ def reset_pdp_contacts_with_unmatched(conn):
113112 conn .execute (Volgistics .insert_into_pdp_contacts ())
114113 conn .execute (ShelterluvPeople .insert_into_pdp_contacts ())
115114
116- def compare_names (n1 , n2 ):
115+
116+ def name_to_array (n ):
117117 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+
119126
120127def get_automatic_matches (conn ):
121128 pc1 = PdpContacts .__table__ .alias ()
You can’t perform that action at this time.
0 commit comments