mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Remove Unnecessary F-strings
This commit is contained in:
@@ -155,8 +155,8 @@ class MailerSendPayload(RequestsPayload):
|
|||||||
# We can't guess which API to use for this send.
|
# We can't guess which API to use for this send.
|
||||||
raise AnymailUnsupportedFeature(
|
raise AnymailUnsupportedFeature(
|
||||||
f"{self.esp_name} requires MAILERSEND_BATCH_SEND_MODE set to either"
|
f"{self.esp_name} requires MAILERSEND_BATCH_SEND_MODE set to either"
|
||||||
f" 'use-bulk-email' or 'expose-to-list' for using batch send"
|
" 'use-bulk-email' or 'expose-to-list' for using batch send"
|
||||||
f" (merge_data) with multiple recipients. See the Anymail docs."
|
" (merge_data) with multiple recipients. See the Anymail docs."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return "email"
|
return "email"
|
||||||
@@ -184,7 +184,7 @@ class MailerSendPayload(RequestsPayload):
|
|||||||
data.append(recipient_data)
|
data.append(recipient_data)
|
||||||
else:
|
else:
|
||||||
raise AssertionError(
|
raise AssertionError(
|
||||||
f"MailerSendPayload.serialize_data missing"
|
"MailerSendPayload.serialize_data missing"
|
||||||
f" case for api_endpoint {api_endpoint!r}"
|
f" case for api_endpoint {api_endpoint!r}"
|
||||||
)
|
)
|
||||||
return self.serialize_json(data)
|
return self.serialize_json(data)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class BrevoTrackingWebhookView(BrevoBaseWebhookView):
|
|||||||
if "items" in esp_event:
|
if "items" in esp_event:
|
||||||
# This is an inbound webhook post
|
# This is an inbound webhook post
|
||||||
raise AnymailConfigurationError(
|
raise AnymailConfigurationError(
|
||||||
f"You seem to have set Brevo's *inbound* webhook URL "
|
"You seem to have set Brevo's *inbound* webhook URL "
|
||||||
f"to Anymail's {self.esp_name} *tracking* webhook URL."
|
f"to Anymail's {self.esp_name} *tracking* webhook URL."
|
||||||
)
|
)
|
||||||
return [self.esp_to_anymail_event(esp_event)]
|
return [self.esp_to_anymail_event(esp_event)]
|
||||||
@@ -156,7 +156,7 @@ class BrevoInboundWebhookView(BrevoBaseWebhookView):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
# This is not an inbound webhook post
|
# This is not an inbound webhook post
|
||||||
raise AnymailConfigurationError(
|
raise AnymailConfigurationError(
|
||||||
f"You seem to have set Brevo's *tracking* webhook URL "
|
"You seem to have set Brevo's *tracking* webhook URL "
|
||||||
f"to Anymail's {self.esp_name} *inbound* webhook URL."
|
f"to Anymail's {self.esp_name} *inbound* webhook URL."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class MailerSendBaseWebhookView(AnymailBaseWebhookView):
|
|||||||
).hexdigest()
|
).hexdigest()
|
||||||
if not constant_time_compare(signature, expected_signature):
|
if not constant_time_compare(signature, expected_signature):
|
||||||
raise AnymailWebhookValidationFailure(
|
raise AnymailWebhookValidationFailure(
|
||||||
f"MailerSend webhook called with incorrect signature"
|
"MailerSend webhook called with incorrect signature"
|
||||||
f" (check Anymail {self._secret_setting_name} setting)"
|
f" (check Anymail {self._secret_setting_name} setting)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class PostmarkInboundWebhookView(PostmarkBaseWebhookView):
|
|||||||
if esp_record_type != "Inbound":
|
if esp_record_type != "Inbound":
|
||||||
raise AnymailConfigurationError(
|
raise AnymailConfigurationError(
|
||||||
f"You seem to have set Postmark's *{esp_record_type}* webhook"
|
f"You seem to have set Postmark's *{esp_record_type}* webhook"
|
||||||
f" to Anymail's Postmark *inbound* webhook URL."
|
" to Anymail's Postmark *inbound* webhook URL."
|
||||||
)
|
)
|
||||||
|
|
||||||
headers = esp_event.get("Headers", [])
|
headers = esp_event.get("Headers", [])
|
||||||
|
|||||||
Reference in New Issue
Block a user