Initial commit: Django inventory system

This commit is contained in:
2025-10-22 01:11:06 +03:00
commit d78c43d9a9
93 changed files with 9204 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from django.core.management.base import BaseCommand
from accounts.models import CustomUser
class Command(BaseCommand):
help = 'Подтверждает email для указанного пользователя'
def add_arguments(self, parser):
parser.add_argument('email', type=str, help='Email пользователя')
def handle(self, *args, **options):
email = options['email']
try:
user = CustomUser.objects.get(email=email)
if user.is_email_confirmed:
self.stdout.write(
self.style.WARNING(f'Email для пользователя {email} уже подтвержден.')
)
else:
user.confirm_email()
self.stdout.write(
self.style.SUCCESS(f'Email для пользователя {email} успешно подтвержден!')
)
except CustomUser.DoesNotExist:
self.stdout.write(
self.style.ERROR(f'Пользователь с email {email} не найден.')
)