flake8 fixes

This commit is contained in:
Chris Meyers
2015-07-20 11:20:17 -04:00
parent 1ead738f96
commit c038bdb1d5
3 changed files with 100 additions and 4 deletions

View File

@@ -47,8 +47,8 @@ class ProjectOptions(models.Model):
def get_local_path_choices(cls):
if os.path.exists(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('_')]
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)
used_paths = qs.values_list('local_path', flat=True)
return [x for x in paths if x not in used_paths]