Revision df455d57 snf-cyclades-app/synnefo/logic/utils.py
b/snf-cyclades-app/synnefo/logic/utils.py | ||
---|---|---|
33 | 33 |
from snf_django.lib.api import faults |
34 | 34 |
from django.conf import settings |
35 | 35 |
from copy import deepcopy |
36 |
from synnefo.util.text import uenc
|
|
36 |
from django.utils.encoding import smart_unicode
|
|
37 | 37 |
|
38 | 38 |
|
39 | 39 |
def id_from_instance_name(name): |
... | ... | |
193 | 193 |
|
194 | 194 |
def check_name_length(name, max_length, message): |
195 | 195 |
"""Check if a string is within acceptable value length""" |
196 |
if len(uenc(name)) > max_length: |
|
196 |
name = smart_unicode(name, encoding="utf-8") |
|
197 |
if len(name) > max_length: |
|
197 | 198 |
raise faults.BadRequest(message) |
Also available in: Unified diff