20 lines
681 B
Python
20 lines
681 B
Python
from django.core.management.base import BaseCommand
|
|
from django.contrib.auth import get_user_model
|
|
from inventory.tasks import create_coa_accounts
|
|
from inventory.models import Dealer
|
|
|
|
User = get_user_model()
|
|
class Command(BaseCommand):
|
|
|
|
def handle(self, *args, **kwargs):
|
|
# user = User.objects.last()
|
|
# print(user.email)
|
|
# # 2. Force email confirmation
|
|
# # email = user.emailaddress_set.first()
|
|
# confirmation = EmailConfirmation.create(user.email)
|
|
# confirmation.send()
|
|
|
|
# result = re.match(r'^05\d{8}$', '0625252522')
|
|
# print(result)
|
|
dealer = Dealer.objects.last()
|
|
create_coa_accounts(dealer.pk) |