Skip to content

Commit 7fd5128

Browse files
committed
Fixed None in generator
1 parent 99ac5fa commit 7fd5128

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

for_dict_challenges_bonus.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def generate_chat_history():
4848
"id": uuid.uuid4(),
4949
"sent_at": sent_at,
5050
"sent_by": random.choice(users_ids),
51-
"reply_for": random.choice([None, random.choice([m["id"] for m in messages]) if messages else []]),
51+
"reply_for": random.choice([None,
52+
random.choice([m["id"] for m in messages])
53+
if messages else None]),
5254
"seen_by": random.sample(users_ids, random.randint(1, len(users_ids))),
5355
"text": lorem.sentence(),
5456
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy