Fix up unicode project directory issue, with unit tests

This commit is contained in:
Matthew Jones
2014-12-15 14:17:07 -05:00
parent d410e1aa2c
commit 9e962d4d5b
2 changed files with 7 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ class ProjectOptions(models.Model):
@classmethod
def get_local_path_choices(cls):
if os.path.exists(settings.PROJECTS_ROOT):
paths = [x for x in os.listdir(settings.PROJECTS_ROOT)
paths = [x.decode('utf-8') for x in os.listdir(settings.PROJECTS_ROOT)
if os.path.isdir(os.path.join(settings.PROJECTS_ROOT, x))
and not x.startswith('.') and not x.startswith('_')]
qs = Project.objects.filter(active=True)