X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1249091e84840ca27aa6047db36c8e899328f15c..ecd1f5bc214a8ba61b65d4d00a7e7d09a8c8fa3a:/src/club/civicrm.py?ds=sidebyside diff --git a/src/club/civicrm.py b/src/club/civicrm.py index c44f6f893..ac3de7039 100644 --- a/src/club/civicrm.py +++ b/src/club/civicrm.py @@ -9,8 +9,8 @@ import yaml class CiviCRM: def __init__(self, base, key): self.base = base - self.api_base = base + 'civicrm/ajax/api4/' self.key = key + self.api_base = (base or '') + 'civicrm/ajax/api4/' self.enabled = bool(self.base and self.key) def request(self, resource, method, params): @@ -89,6 +89,9 @@ class CiviCRM: def report_activity(self, email, tpwl_key, key, name, datetime, details): + if not self.enabled: + return + contact_id = self.create_or_update_contact(email, tpwl_key) activity_id = self.get_activity_id(key)