mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Used ternary if/else in utils.lorem_ipsum.words().
This commit is contained in:
parent
e5d3f98abc
commit
fb1349ce8c
@ -103,10 +103,7 @@ def words(count, common=True):
|
||||
If `common` is True, then the first 19 words will be the standard
|
||||
'lorem ipsum' words. Otherwise, all words will be selected randomly.
|
||||
"""
|
||||
if common:
|
||||
word_list = list(COMMON_WORDS)
|
||||
else:
|
||||
word_list = []
|
||||
word_list = list(COMMON_WORDS) if common else []
|
||||
c = len(word_list)
|
||||
if count > c:
|
||||
count -= c
|
||||
|
Loading…
Reference in New Issue
Block a user