forked from uncloud/uncloud
Initial product activation implementation
This commit is contained in:
parent
839bd5f8a9
commit
5d5bf486b5
3 changed files with 43 additions and 24 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
from uncloud_auth.models import User
|
||||
from uncloud_pay.models import Order, Bill, PaymentMethod, get_balance_for
|
||||
from uncloud_pay.models import Order, Bill, PaymentMethod, get_balance_for_user
|
||||
|
||||
from datetime import timedelta
|
||||
from django.utils import timezone
|
||||
|
|
@ -15,7 +15,7 @@ class Command(BaseCommand):
|
|||
users = User.objects.all()
|
||||
print("Processing {} users.".format(users.count()))
|
||||
for user in users:
|
||||
balance = get_balance_for(user)
|
||||
balance = get_balance_for_user(user)
|
||||
if balance < 0:
|
||||
print("User {} has negative balance ({}), charging.".format(user.username, balance))
|
||||
payment_method = PaymentMethod.get_primary_for(user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue