Fixed truncated downloaded filenames in firefox

This commit is contained in:
Fergal Moran
2014-05-03 16:42:22 +01:00
parent 6ecec7af01
commit cc2a433410
4 changed files with 9 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
#curl -u hb_client_2862_1:j2CbCM8H -H 'Accept: application/json' -H 'Content-type: application/json' http://c1.lon2.dediserve.com/virtual_machines.xml
apt-get install git python-virtualenv postgresql postgresql-client postgresql-client-common postgresql-dev-all rabbitmq-server libsndfile1-dev libpng++-dev libpng12-dev libboost-program-options-dev libjpeg-dev python-dev
apt-get install git python-virtualenv postgresql-common libsndfile1-dev libpng++-dev libpng12-dev libboost-program-options-dev libjpeg-dev python-dev
virtualenv env
source env/bin/activate

View File

@@ -1,11 +1,11 @@
Django==1.6.1
PIL>=1.1.7
#PIL>=1.1.7 #install PIL manually
south
beautifulsoup4>=4.1.1
decorator>=3.3.3
django-allauth>=0.7.0
django-annoying>=0.7.6
django-celery>=3.0.4
django-celery
django-gravatar2>=1.0.6
django-socialauth>=0.1.2c
django-tastypie>=0.9.11
@@ -19,9 +19,11 @@ git+git://github.com/hpoul/sct-communitytools.git#django-sct
git+git://github.com/jefftriplett/django-podcast.git#django-podcast
git+git://github.com/etianen/django-require.git#django-require
git+git://github.com/spookylukey/django-paypal.git#django-paypal
git+git://github.com/llazzaro/django-scheduler.git#django-scheduler
django-templated-email
django-grappelli
humanize
mandrill
django-debug-toolbar
sorl-thumbnail
django_extensions

View File

@@ -40,7 +40,7 @@ def download(request, mix_id):
response = HttpResponse(FileWrapper(open(audio_file)),
content_type=mimetypes.guess_type(audio_file)[0])
response['Content-Length'] = os.path.getsize(audio_file)
response['Content-Disposition'] = "attachment; filename=Deep South Sounds - %s%s" % (
response['Content-Disposition'] = "attachment; filename=\"Deep South Sounds - %s%s\"" % (
mix.title, extension)
return response
else:
@@ -49,7 +49,7 @@ def download(request, mix_id):
except Exception, ex:
print ex
return Http404("Mix not found")
raise Http404("Mix not found")
def start_streaming(request, mix_id):

View File

@@ -13,6 +13,7 @@ class Show(Event):
"""
throw an exception if event overlaps with another event
"""
import ipdb; ipdb.set_trace()
overlaps = Show.objects.filter(
Q(start__gte=self.start, end__lte=self.start) |
Q(start__gte=self.end, end__lte=self.end)
@@ -20,4 +21,4 @@ class Show(Event):
if len(overlaps) != 0:
raise ShowOverlapException()
return super(Show, self).save(force_insert, force_update, using, update_fields)
return super(Show, self).save(force_insert, force_update, using, update_fields)