|
@@ -21,6 +21,7 @@ class Command(BaseCommand):
|
|
|
can be passed as argument."""
|
|
|
|
|
|
def handle(self, *args, **options):
|
|
|
+ verbosity = int(options['verbosity'])
|
|
|
try:
|
|
|
date = datetime.datetime.strptime(args[0], '%Y-%m-%d').date()
|
|
|
except IndexError:
|
|
@@ -35,7 +36,7 @@ class Command(BaseCommand):
|
|
|
date,
|
|
|
date + relativedelta(months=+1)]
|
|
|
|
|
|
- if options['verbosity'] >= 2:
|
|
|
+ if verbosity >= 2:
|
|
|
self.stdout.write("Selecting members whose membership fee end at "
|
|
|
"the following dates : {dates}".format(
|
|
|
dates=[str(d) for d in end_dates]))
|
|
@@ -43,7 +44,7 @@ class Command(BaseCommand):
|
|
|
members = Member.objects.filter(status='member')\
|
|
|
.annotate(end=Max('membership_fees__end_date'))\
|
|
|
.filter(end__in=end_dates)
|
|
|
- if options['verbosity'] >= 2:
|
|
|
+ if verbosity >= 2:
|
|
|
self.stdout.write(
|
|
|
"Got {number} members.".format(number=members.count()))
|
|
|
|
|
@@ -56,6 +57,6 @@ class Command(BaseCommand):
|
|
|
member=member, email=member.email))
|
|
|
cpt = cpt + 1
|
|
|
|
|
|
- if cpt > 0 or options['verbosity'] >= 2:
|
|
|
+ if cpt > 0 or verbosity >= 2:
|
|
|
self.stdout.write("{number} call for membership fees emails were "
|
|
|
"sent".format(number=cpt))
|