diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index 368c53f966c5f7..f142f4d311997c 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -179,16 +179,16 @@ def handle(self, **options): Recipient.objects.filter(type=Recipient.STREAM)] # Extract a list of all users - user_profiles = list(UserProfile.objects.all()) # type: List[Any] + user_profiles = list(UserProfile.objects.all()) # type: UserProfile # Populate users with some bar data for user in user_profiles: - month = random.randint(range(1, 12)) # type: Any - day = random.raindint(range(1, 28)) # type: Any + month = random.randint(1, 12) # type: int + day = random.randint(1, 28) # type: int status = 2 # type: int date = datetime.datetime(2015, month, day) # type: datetime.datetime - client = random.randint(range(1, 2)) # type: Any - if random_client == 1: + client = random.randint(1, 2) # type: int + if client == 1: client = get_client("API") else: client = get_client("website") @@ -197,10 +197,10 @@ def handle(self, **options): user_profiles_ids = [user_profile.id for user_profile in user_profiles] # Create several initial huddles for i in range(options["num_huddles"]): - get_huddle(random.sample(user_profiles_id, random.randint(3, 4))) + get_huddle(random.sample(user_profiles_ids, random.randint(3, 4))) # Create several initial pairs for personals - personals_pairs = [random.sample(user_profiles_id, 2) + personals_pairs = [random.sample(user_profiles_ids, 2) for i in range(options["num_personals"])] threads = options["threads"]