From 171a3f4d921e0113b93c6d325a2070f384a70ec2 Mon Sep 17 00:00:00 2001 From: imperosol Date: Tue, 2 Sep 2025 15:31:54 +0200 Subject: [PATCH] make some users not having birthday in populate_more.py --- core/management/commands/populate_more.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/management/commands/populate_more.py b/core/management/commands/populate_more.py index f9456712..38803dc8 100644 --- a/core/management/commands/populate_more.py +++ b/core/management/commands/populate_more.py @@ -94,7 +94,11 @@ class Command(BaseCommand): username=self.faker.user_name(), first_name=self.faker.first_name(), last_name=self.faker.last_name(), - date_of_birth=self.faker.date_of_birth(minimum_age=15, maximum_age=25), + date_of_birth=( + None + if random.random() < 0.2 + else self.faker.date_of_birth(minimum_age=15, maximum_age=25) + ), email=self.faker.email(), phone=self.faker.phone_number(), address=self.faker.address(),