TypeError: add() missing 1 required positional argument: 'resubscribe' in Django 3
Здесь я использую Django 3.0 и Python 3.7
Я получаю 2 ошибки здесь:
TypeError: add() missing 1 required positional argument: 'consent_to_track'
TypeError: add() missing 1 required positional argument: 'resubscribe'
Вот мой код из models.py, где возникает проблема
def subscribe_to_signup_email_list(self):
# campaign monitor
subscriber = createsend.Subscriber({'api_key': settings.CAMPAIGN_MONITOR_API_KEY}, settings.CAMPAIGN_MONITOR_LIST_MCAM_ADMINS, self.email)
try:
email_returned = subscriber.add(settings.CAMPAIGN_MONITOR_LIST_MCAM_ADMINS, self.email, self.name, [], True)
except Exception as e:
'''
print type(e)
print e.args
print e
'''
# it is not obvious what the error is
subject, from_email, to = 'Welcome Email Error', 'noreply@mycontactandme.com', "notifications+errors@mycontactandme.com"
client = self.client
text_content = "Name: " + self.name + "\n"
text_content += "Email: " + self.email + "\n"
text_content += "Phone: " + client.phone + "\n"
text_content += "Company: " + client.name + "\n"
text_content += "Website: " + client.website + "\n"
text_content += "Country: " + client.country + "\n"
text_content += "\n\n" + traceback.format_exc() + "\n"
msg = EmailMultiAlternatives(subject, text_content, from_email, [to], [])
msg.send()
return False
return True
Вот трассировка моей ошибки для ошибки 1 (т.е. TypeError: add() missing 1 required positional argument: 'consent_to_track')
>Traceback (most recent call last):
File "/home/harika/krishna test/dev-1.8/mcam/server/mcam/core/models.py", line 1005, in subscribe_to_signup_email_list
email_returned = subscriber.add(settings.CAMPAIGN_MONITOR_LIST_MCAM_ADMINS, self.email, self.name, [], True)
TypeError: add() missing 1 required positional argument: 'consent_to_track'
Вот трассировка моей ошибки для ошибки 2 (т.е. TypeError: add() missing 1 required positional argument: 'resubscribe')
Traceback (most recent call last):
File "/home/harika/krishna test/dev-1.8/mcam/server/mcam/core/models.py", line 1005, in subscribe_to_signup_email_list
email_returned = subscriber.add(settings.CAMPAIGN_MONITOR_LIST_MCAM_ADMINS, self.email, self.name, [], consent_to_track=True)
TypeError: add() missing 1 required positional argument: 'resubscribe'
Пожалуйста, помогите мне, как я могу решить эти две проблемы