Skip to content

Commit

Permalink
Remove unnecessary string concatenations
Browse files Browse the repository at this point in the history
  • Loading branch information
eht16 committed Feb 8, 2024
1 parent 990cd03 commit 8fa00a2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit 8fa00a2

Please sign in to comment.