Skip to content

Commit 307cfec

Browse files
renzonrenzon
authored andcommitted
Temporary fix to not alter wrong user on Active Campaign. It will fallback to email
Hold #1796
1 parent e54c054 commit 307cfec

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

pythonpro/email_marketing/facade.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ def _create_or_update(name: str, email: str, role: str, *tags, id='0'):
5858

5959

6060
def _find_active_campaign_contact_id(id):
61+
raise ActiveCampaignError()
6162
id = str(id)
62-
return _client.contacts.list({'filters[fields][%PYTHONPRO_ID%]': id})['0']['id']
63+
contacts_list = _client.contacts.list({'filters[fields][%PYTHONPRO_ID%]': id})
64+
return contacts_list['0']['id']
6365

6466

6567
def grant_role(email, id, role: str):
@@ -122,13 +124,14 @@ def _get_lists():
122124

123125
if __name__ == '__main__':
124126
# client = create_or_update_lead('Renzo Nuccitelli', 'renzo@python.pro.br', id=1)
125-
client = tag_as('renzo@python.pro.br', 1, 'outro_teste')
126-
print(client)
127-
client = tag_as('renzo@python.pro.br', 2, 'a', 'b')
128-
print(client)
129-
client = remove_tags('renzo@python.pro.br', 1, 'outro_teste')
130-
print(client)
131-
client = remove_tags('renzo@python.pro.br', 2, 'a', 'b')
132-
print(client)
133-
grant_role('renzo@python.pro.br', 1, 'client')
134-
grant_role('renzo@python.pro.br', 2, 'member')
127+
# client = tag_as('renzo@python.pro.br', 1, 'outro_teste')
128+
# print(client)
129+
# client = tag_as('renzo@python.pro.br', 2, 'a', 'b')
130+
# print(client)
131+
# client = remove_tags('renzo@python.pro.br', 1, 'outro_teste')
132+
# print(client)
133+
# client = remove_tags('renzo@python.pro.br', 2, 'a', 'b')
134+
# print(client)
135+
# grant_role('renzo@python.pro.br', 1, 'client')
136+
# grant_role('renzo@python.pro.br', 2, 'member')
137+
print(_find_active_campaign_contact_id(1))

0 commit comments

Comments
 (0)