@@ -66,6 +66,9 @@ def update_interested_user(self, interested_user):
66
66
"state = %s, "
67
67
"postal_code = %s, "
68
68
"country = %s, "
69
+ "latitude = %s, "
70
+ "longitude = %s, "
71
+ "confirm_consent = %s, "
69
72
"address_checked = %s, "
70
73
"address_valid = %s, "
71
74
"residential_address = %s, "
@@ -82,6 +85,9 @@ def update_interested_user(self, interested_user):
82
85
interested_user .state ,
83
86
interested_user .postal_code ,
84
87
interested_user .country ,
88
+ interested_user .latitude ,
89
+ interested_user .longitude ,
90
+ interested_user .confirm_consent ,
85
91
interested_user .address_checked ,
86
92
interested_user .address_valid ,
87
93
interested_user .residential_address ,
@@ -207,3 +213,41 @@ def verify_address(self, interested_user_id):
207
213
(interested_user_id ,)
208
214
)
209
215
return False
216
+
217
+ def get_interested_user_by_just_email (self , email ):
218
+ with self ._transaction .dict_cursor () as cur :
219
+ cur .execute (
220
+ "SELECT * FROM campaign.interested_users "
221
+ "WHERE lower(email) = lower(%s)" ,
222
+ (email ,)
223
+ )
224
+ rs = cur .fetchall ()
225
+ return [__class__ ._row_to_interested_user (r ) for r in rs ]
226
+
227
+ def scrub (self , interested_user_email ):
228
+ interested_users = self . \
229
+ get_interested_user_by_just_email (interested_user_email )
230
+
231
+ for interested_user in interested_users :
232
+ interested_user .first_name = "scrubbed"
233
+ interested_user .last_name = "scrubbed"
234
+ interested_user .email = "scrubbed"
235
+ interested_user .phone = "scrubbed"
236
+ interested_user .address_1 = "scrubbed"
237
+ interested_user .address_2 = "scrubbed"
238
+ interested_user .address_3 = "scrubbed"
239
+ interested_user .city = "scrubbed"
240
+ interested_user .state = "scrubbed"
241
+ interested_user .postal_code = "scrubbed"
242
+ interested_user .country = "scrubbed"
243
+ interested_user .latitude = None
244
+ interested_user .longitude = None
245
+ interested_user .confirm_consent = False
246
+ interested_user .ip_address = "scrubbed"
247
+ interested_user .address_checked = False
248
+ interested_user .address_valid = False
249
+ interested_user .residential_address = False
250
+
251
+ if not self .update_interested_user (interested_user ):
252
+ raise RepoException ("Error scrubbing interested user: "
253
+ + interested_user .interested_user_id )
0 commit comments