Permalink
Browse files

fix #7. random image and file return names without upload_to component

  • Loading branch information...
1 parent f277be5 commit a611ad89497b4145fc89798d4c2b9f22992e683e @rob-b rob-b committed Jan 6, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 dilla/spammers.py
View
@@ -132,15 +132,15 @@ def _random_image(field):
random.randint(5 ** 5, 10 ** 10), \
random.randint(64, 250))
icon.save(os.path.join(destination, name), 'PNG')
- return name
+ return os.path.join(field.upload_to, name)
def _random_textfile(field):
log.debug("Generating text file")
name = "dilla_%s.txt" % random_slug(field)
f = open(os.path.join(destination, name), "w+")
f.write(_random_words(10))
f.close()
- return name
+ return os.path.join(field.upload_to, name)
try:
from django.db.models import ImageField

0 comments on commit a611ad8

Please sign in to comment.