Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #371 -- Fixed bug in 'random' template filter. Thanks, Boffbowsh

git-svn-id: http://code.djangoproject.com/svn/django/trunk@538 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8d6c276328b43ab0351cbfae9bcfcacfa9fdd47d 1 parent a9c36d8
Adrian Holovaty adrianholovaty authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/core/defaultfilters.py
5 django/core/defaultfilters.py
View
@@ -1,6 +1,7 @@
"Default variable filters"
-import template, re, random
+import template, re
+import random as random_module
###################
# STRINGS #
@@ -232,7 +233,7 @@ def length_is(value, arg):
def random(value, _):
"Returns a random item from the list"
- return random.choice(value)
+ return random_module.choice(value)
def slice_(value, arg):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.