Django

Code

Changeset 5190

Show
Ignore:
Timestamp:
05/11/07 04:44:13 (2 years ago)
Author:
mtredinnick
Message:

Fixed #4276 -- Fixed a crash in the lorem tag when more than 20 words were
requested.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/webdesign/lorem_ipsum.py

    r5189 r5190  
    6060    c = len(word_list) 
    6161    if count > c: 
    62         count = min(count - c, len(WORDS)) 
    63         word_list += random.sample(WORDS, count - c) 
     62        count -= c 
     63        while count > 0: 
     64            c = min(count, len(WORDS)) 
     65            count -= c 
     66            word_list += random.sample(WORDS, c) 
    6467    else: 
    6568        word_list = word_list[:count]