Commits

Viliam Segeda committed ebe4c52

fix: quote file path in url

  • Participants
  • Parent commits bb44105

Comments (0)

Files changed (1)

country_pages/page_processors.py

 from django.shortcuts import redirect
 from django.template import RequestContext
-
+from django.utils.encoding import filepath_to_uri
 from mezzanine.conf import settings
 from mezzanine.forms.forms import FormForForm
 from mezzanine.forms.signals import form_invalid, form_valid
                 if field.type == 'filefield':
                     pk = int(k.replace('field_',''))
                     fieldentry = entry.fields.get(field_id=pk)
-                    value = 'http://' + request.get_host() + settings.MEDIA_URL + fieldentry.value
+                    value = 'http://' + request.get_host() + settings.MEDIA_URL + filepath_to_uri(fieldentry.value)
                 else:
                     value = format_value(form.cleaned_data[k])
                 fields.append((field.label, value))