Skip to content

Commit d8846b7

Browse files
committed
Salesforce Integration: Fix updating blank tags to Salesforce
1 parent c182f9c commit d8846b7

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

salesforce/campaign.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,16 @@ def save(project: object):
2626
"description_action__c": project.project_description_actions,
2727
"description_solution__c": project.project_description_solution,
2828
"short_description__c": project.project_short_description,
29-
"description": project.project_description
29+
"description": project.project_description,
30+
"issue_area__c": Tag.tags_field_descriptions(project.project_issue_area),
31+
"stage__c": Tag.tags_field_descriptions(project.project_stage),
32+
"type": Tag.tags_field_descriptions(project.project_organization_type),
33+
"technologies__c": Tag.tags_field_descriptions(project.project_technologies)
3034
}
3135

3236
if project.project_date_created:
3337
data['startdate'] = project.project_date_created.strftime('%Y-%m-%d')
3438

35-
issue_area_tags = Tag.tags_field_descriptions(project.project_issue_area)
36-
if issue_area_tags:
37-
data['issue_area__c'] = issue_area_tags
38-
stage_tags = Tag.tags_field_descriptions(project.project_stage)
39-
if stage_tags:
40-
data['stage__c'] = stage_tags
41-
org_type_tags = Tag.tags_field_descriptions(project.project_organization_type)
42-
if org_type_tags:
43-
data['type'] = org_type_tags
44-
tech_tags = Tag.tags_field_descriptions(project.project_technologies)
45-
if tech_tags:
46-
data['technologies__c'] = tech_tags
4739
req = requests.Request(
4840
method="PATCH",
4941
url=f'{client.campaign_endpoint}/platform_id__c/{project.id}',

salesforce/contact.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ def save(contributor: object):
2222
"mailingcountry": contributor.country,
2323
"npo02__membershipjoindate__c": contributor.date_joined.strftime('%Y-%m-%d'),
2424
"description": contributor.about_me,
25+
'technologies__c': Tag.tags_field_descriptions(contributor.user_technologies)
2526
}
26-
tech_tags = Tag.tags_field_descriptions(contributor.user_technologies)
27-
if tech_tags:
28-
data['technologies__c'] = tech_tags
2927

3028
req = requests.Request(
3129
method="PATCH",

0 commit comments

Comments
 (0)