Skip to content

Commit 8882cee

Browse files
authored
handle non-useful thank you notes (#1609)
* handle non-useful thank you notes * school -> find me a home
1 parent 421377d commit 8882cee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

salesforce/management/commands/sync_thank_you_notes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ def handle(self, *args, **options):
1919
with Salesforce() as sf:
2020
num_created = 0
2121
for note in new_thank_you_notes:
22+
# junk removal
23+
if note.thank_you_note and len(note.thank_you_note) < 5: # we expect at least a 'thank'
24+
note.delete()
25+
# junk school rename
26+
if note.institution and note.institution.isdigit(): # we expect at least text
27+
note.institution = "Find Me A Home" # Use Find Me A Home
28+
note.save()
29+
30+
2231
account_id = school_list["Find Me A Home"]
2332

2433
# If note has a school name, see if we can match it and use that account id when creating

0 commit comments

Comments
 (0)