Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary string concatenations #174

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mailer/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ def _limits_reached(sent, deferred):
EMAIL_MAX_BATCH = getattr(settings, "MAILER_EMAIL_MAX_BATCH", None)

if EMAIL_MAX_BATCH is not None and sent >= EMAIL_MAX_BATCH:
logger.info("EMAIL_MAX_BATCH (%s) reached, " "stopping for this round", EMAIL_MAX_BATCH)
logger.info("EMAIL_MAX_BATCH (%s) reached, stopping for this round", EMAIL_MAX_BATCH)
return True

# Stop sending emails in the current round if more than X emails get
# deferred - defaults to None which means keep going regardless
EMAIL_MAX_DEFERRED = getattr(settings, "MAILER_EMAIL_MAX_DEFERRED", None)

if EMAIL_MAX_DEFERRED is not None and deferred >= EMAIL_MAX_DEFERRED:
logger.warning("EMAIL_MAX_DEFERRED (%s) reached, " "stopping for this round", EMAIL_MAX_DEFERRED)
logger.warning("EMAIL_MAX_DEFERRED (%s) reached, stopping for this round", EMAIL_MAX_DEFERRED)
return True


Expand Down
2 changes: 1 addition & 1 deletion src/mailer/management/commands/purge_mail_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def add_arguments(self, parser):
"-r",
"--result",
choices=RESULT_CODES.keys(),
help="Delete logs of messages with the given result code(s) " "(default: success)",
help="Delete logs of messages with the given result code(s) (default: success)",
)

def handle(self, *args, **options):
Expand Down
2 changes: 1 addition & 1 deletion src/mailer/management/commands/retry_deferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Command(CronArgMixin, BaseCommand):
def handle(self, *args, **options):
if options["cron"]:
warnings.warn(
"retry_deferred's -c/--cron option is no longer " "necessary and will be removed in a future release",
"retry_deferred's -c/--cron option is no longer necessary and will be removed in a future release",
DeprecationWarning,
)
count = Message.objects.retry_deferred() # @@@ new_priority not yet supported
Expand Down
2 changes: 1 addition & 1 deletion src/mailer/management/commands/send_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Command(CronArgMixin, BaseCommand):
def handle(self, *args, **options):
if options["cron"] == 0:
warnings.warn(
"send_mail's -c/--cron option is no longer " "necessary and will be removed in a future release",
"send_mail's -c/--cron option is no longer necessary and will be removed in a future release",
DeprecationWarning,
)
logger.info("-" * 72)
Expand Down
Loading