Revision df455d57 snf-cyclades-app/synnefo/plankton/views.py
b/snf-cyclades-app/synnefo/plankton/views.py | ||
---|---|---|
39 | 39 |
|
40 | 40 |
from django.conf import settings |
41 | 41 |
from django.http import HttpResponse |
42 |
from django.utils.encoding import smart_unicode |
|
42 | 43 |
|
43 | 44 |
from snf_django.lib import api |
44 | 45 |
from snf_django.lib.api import faults |
45 |
from synnefo.util.text import uenc |
|
46 | 46 |
from synnefo.plankton.utils import image_backend |
47 | 47 |
from synnefo.plankton.backend import split_url, InvalidLocation |
48 | 48 |
|
... | ... | |
87 | 87 |
if key == 'properties': |
88 | 88 |
for k, v in image.get('properties', {}).items(): |
89 | 89 |
name = 'x-image-meta-property-' + k.replace('_', '-') |
90 |
response[name] = uenc(v)
|
|
90 |
response[name] = smart_unicode(v, encoding="utf-8")
|
|
91 | 91 |
else: |
92 | 92 |
name = 'x-image-meta-' + key.replace('_', '-') |
93 |
response[name] = uenc(image.get(key, ''))
|
|
93 |
response[name] = smart_unicode(image.get(key, ''), encoding="utf-8")
|
|
94 | 94 |
|
95 | 95 |
return response |
96 | 96 |
|
... | ... | |
152 | 152 |
name = params.pop('name') |
153 | 153 |
if name is None: |
154 | 154 |
raise faults.BadRequest("Image 'name' parameter is required") |
155 |
elif len(uenc(name)) == 0:
|
|
155 |
elif len(smart_unicode(name, encoding="utf-8")) == 0:
|
|
156 | 156 |
raise faults.BadRequest("Invalid image name") |
157 | 157 |
location = params.pop('location', None) |
158 | 158 |
if location is None: |
Also available in: Unified diff