Display more info about tracked files to user e.g creation_date, host on which it is stored, size etc
This commit is contained in:
parent
48cc37c438
commit
b4292615de
1 changed files with 9 additions and 11 deletions
|
@ -289,18 +289,16 @@ class ListUserFiles(Resource):
|
||||||
settings['etcd']['file_prefix'], value_in_json=True
|
settings['etcd']['file_prefix'], value_in_json=True
|
||||||
)
|
)
|
||||||
return_files = []
|
return_files = []
|
||||||
user_files = list(
|
user_files = [f for f in files if f.value['owner'] == data['name']]
|
||||||
filter(
|
|
||||||
lambda f: f.value['owner'] == data['name'], files
|
|
||||||
)
|
|
||||||
)
|
|
||||||
for file in user_files:
|
for file in user_files:
|
||||||
return_files.append(
|
file_uuid = file.key.split('/')[-1]
|
||||||
{
|
file = file.value
|
||||||
'filename': file.value['filename'],
|
file['uuid'] = file_uuid
|
||||||
'uuid': file.key.split('/')[-1],
|
|
||||||
}
|
file.pop('sha512sum', None)
|
||||||
)
|
file.pop('owner', None)
|
||||||
|
|
||||||
|
return_files.append(file)
|
||||||
return {'message': return_files}, 200
|
return {'message': return_files}, 200
|
||||||
else:
|
else:
|
||||||
return validator.get_errors(), 400
|
return validator.get_errors(), 400
|
||||||
|
|
Loading…
Reference in a new issue