Commit d845676b authored by fred's avatar fred
Browse files

don't check for validation status if validation is disabled

parent 4e457abe
from optparse import make_option from django.conf import settings
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from ...models import Subscriber from ...models import Subscriber
...@@ -9,7 +8,11 @@ class Command(BaseCommand): ...@@ -9,7 +8,11 @@ class Command(BaseCommand):
def handle(self, verbosity, **kwargs): def handle(self, verbosity, **kwargs):
self.verbose = verbosity > 1 self.verbose = verbosity > 1
for subscriber in Subscriber.objects.filter(is_validated=True).exclude(is_registered=True): qs = Subscriber.objects.exclude(is_registered=True)
if getattr(settings, 'NEWSLETTER_SEND_CONFIRMATION', True):
qs = qs.filter(is_validated=True)
for subscriber in qs:
if self.verbose: if self.verbose:
print('subscribing', subscriber.email) print('subscribing', subscriber.email)
subscriber.subscribe() subscriber.subscribe()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment