24 lines
822 B
Python
24 lines
822 B
Python
from django.core.management.base import BaseCommand
|
|
from django.core.mail import send_mail
|
|
from allauth.account.models import EmailConfirmation
|
|
from inventory.tasks import send_email
|
|
from django.contrib.auth import get_user_model
|
|
import re
|
|
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) |