Skip to content

Commit

Permalink
Use self.stdout in management commands instead of print
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Aug 30, 2017
1 parent f49cceb commit 4662758
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pinax/stripe/management/commands/init_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def handle(self, *args, **options):
User = get_user_model()
for user in User.objects.filter(customer__isnull=True):
customers.create(user=user)
print("Created customer for {0}".format(user.email))
self.stdout.write("Created customer for {0}\n".format(user.email))
2 changes: 1 addition & 1 deletion pinax/stripe/management/commands/sync_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def handle(self, *args, **options):
count += 1
perc = int(round(100 * (float(count) / float(total))))
username = getattr(user, user.USERNAME_FIELD)
print(u"[{0}/{1} {2}%] Syncing {3} [{4}]".format(
self.stdout.write(u"[{0}/{1} {2}%] Syncing {3} [{4}]\n".format(
count, total, perc, username, user.pk
))
customer = customers.get_customer_for_user(user)
Expand Down

0 comments on commit 4662758

Please sign in to comment.