Mercurial > public > sg101
diff gpp/downloads/management/commands/dlwgetcat.py @ 528:311c926dd218
Must urlencode the filenames.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 21 Dec 2011 01:25:10 +0000 |
parents | 645025056dfa |
children |
line wrap: on
line diff
--- a/gpp/downloads/management/commands/dlwgetcat.py Wed Dec 21 01:08:21 2011 +0000 +++ b/gpp/downloads/management/commands/dlwgetcat.py Wed Dec 21 01:25:10 2011 +0000 @@ -34,8 +34,6 @@ downloads = Download.public_objects.filter(category=category).order_by( 'title').select_related() - current_site = Site.objects.get_current() - # Create new destination names for the files since the uploaders often # give the files terrible names. The new names will be slugified # versions of the titles, with the same extension. @@ -44,12 +42,10 @@ ext = os.path.splitext(dl.file.name)[1] dl.dest_filename = slugify(dl.title) + ext - # build a full URL to the download - dl.full_url = 'http://%s%s%s' % (current_site.domain, - settings.MEDIA_URL, dl.file.name) - output = render_to_string('downloads/commands/wget_cat.html', { 'downloads': downloads, + 'domain': Site.objects.get_current().domain, + 'MEDIA_URL': settings.MEDIA_URL, }) # encode it ourselves since it can fail if you try to redirect output to