Skip to content

Commit

Permalink
Do not send emails during fixturize
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbru committed Oct 24, 2024
1 parent 7008741 commit ceafa02
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from contextlib import contextmanager
from io import StringIO

from django.conf import settings
from django.core import management
from django.core.management.base import BaseCommand
from django.db import connection
Expand Down Expand Up @@ -45,6 +46,9 @@ def print_step(self, message):
self.stdout.write(self.style.SUCCESS("OK"))

def handle(self, *args, **options):
# Do not send emails when performing fake tasks
settings.EMAIL_BACKEND = "django.core.mail.backends.dummy.EmailBackend"

if not options["force_yes"]:
self.stdout.write(
self.style.WARNING("WARNING")
Expand Down

0 comments on commit ceafa02

Please sign in to comment.