# HG changeset patch # User Brian Neal # Date 1406768841 18000 # Node ID 762e46d0bb4a84cbeee23ea65933952cc3afecf8 # Parent a9d39fafacafc553a27a7d0fef4f76c2f1b903c4 urlquote photologue filenames when building URLs. diff -r a9d39fafacaf -r 762e46d0bb4a photologue/models.py --- a/photologue/models.py Fri Jul 04 14:25:36 2014 -0500 +++ b/photologue/models.py Wed Jul 30 20:07:21 2014 -0500 @@ -13,6 +13,7 @@ from django.utils.text import slugify from django.utils.functional import curry from django.utils.translation import ugettext_lazy as _ +from django.utils.http import urlquote # Required PIL classes may or may not be available from the root namespace # depending on the installation method used. @@ -306,7 +307,8 @@ if photosize.increment_count: self.view_count += 1 self.save(update=True) - return '/'.join([self.cache_url(), self._get_filename_for_size(photosize.name)]) + return '/'.join([self.cache_url(), + urlquote(self._get_filename_for_size(photosize.name))]) def _get_SIZE_filename(self, size): photosize = PhotoSizeCache().sizes.get(size)