mirror of https://github.com/django/django.git
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
|
If `common` is True, then the first 19 words will be the standard
|
||||||
'lorem ipsum' words. Otherwise, all words will be selected randomly.
|
'lorem ipsum' words. Otherwise, all words will be selected randomly.
|
||||||
"""
|
"""
|
||||||
if common:
|
word_list = list(COMMON_WORDS) if common else []
|
||||||
word_list = list(COMMON_WORDS)
|
|
||||||
else:
|
|
||||||
word_list = []
|
|
||||||
c = len(word_list)
|
c = len(word_list)
|
||||||
if count > c:
|
if count > c:
|
||||||
count -= c
|
count -= c
|
||||||
|
|
Loading…
Reference in New Issue