revert the list_all behavior back to just returning a list of the filenames
rather than a list of objects --HG-- extra : rebase_source : 19598af5f4b3f8e22e7502a0ccfd63808a38cf64
This commit is contained in:
Родитель
6940aa5ae3
Коммит
bbcf9b0d82
|
@ -349,7 +349,7 @@ def file_list_all(request, response):
|
|||
else:
|
||||
pname = project.owner.username + "+" + project.short_name
|
||||
metadata = project.metadata
|
||||
files.extend({ 'name':pname + name }
|
||||
files.extend(pname + name
|
||||
for name in metadata.get_file_list())
|
||||
metadata.close()
|
||||
else:
|
||||
|
@ -358,7 +358,7 @@ def file_list_all(request, response):
|
|||
project = get_project(user, user, project_name)
|
||||
metadata = project.metadata
|
||||
|
||||
files.extend({ 'name':name } for name in metadata.get_file_list(path))
|
||||
files.extend(name for name in metadata.get_file_list(path))
|
||||
metadata.close()
|
||||
|
||||
return _respond_json(response, files)
|
||||
|
|
|
@ -251,7 +251,7 @@ def test_list_all():
|
|||
data = simplejson.loads(resp.body)
|
||||
assert isinstance(data, list)
|
||||
assert len(data) == 1
|
||||
assert data[0] == dict(name="bar/baz.txt")
|
||||
assert data[0] == "bar/baz.txt"
|
||||
|
||||
resp = app.get("/file/list_all/")
|
||||
assert resp.content_type == "application/json"
|
||||
|
|
Загрузка…
Ссылка в новой задаче