@@ -58,8 +58,10 @@ def _create_or_update(name: str, email: str, role: str, *tags, id='0'):
5858
5959
6060def _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
6567def grant_role (email , id , role : str ):
@@ -122,13 +124,14 @@ def _get_lists():
122124
123125if __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