mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 06:34:40 +00:00
add last modifier info to file detail api
This commit is contained in:
@@ -2894,6 +2894,10 @@ class FileDetailView(APIView):
|
|||||||
except UserStarredFiles.DoesNotExist:
|
except UserStarredFiles.DoesNotExist:
|
||||||
entry["starred"] = False
|
entry["starred"] = False
|
||||||
|
|
||||||
|
entry["last_modifier_email"] = latest_contributor
|
||||||
|
entry["last_modifier_name"] = email2nickname(latest_contributor)
|
||||||
|
entry["last_modifier_contact_email"] = email2contact_email(latest_contributor)
|
||||||
|
|
||||||
return HttpResponse(json.dumps(entry), status=200,
|
return HttpResponse(json.dumps(entry), status=200,
|
||||||
content_type=json_content_type)
|
content_type=json_content_type)
|
||||||
|
|
||||||
|
@@ -218,6 +218,10 @@ class FilesApiTest(ApiTestBase):
|
|||||||
self.assertIsNotNone(detail['type'])
|
self.assertIsNotNone(detail['type'])
|
||||||
self.assertIsNotNone(detail['name'])
|
self.assertIsNotNone(detail['name'])
|
||||||
self.assertIsNotNone(detail['size'])
|
self.assertIsNotNone(detail['size'])
|
||||||
|
self.assertIsNotNone(detail['starred'])
|
||||||
|
self.assertIsNotNone(detail['last_modifier_email'])
|
||||||
|
self.assertIsNotNone(detail['last_modifier_name'])
|
||||||
|
self.assertIsNotNone(detail['last_modifier_contact_email'])
|
||||||
|
|
||||||
def test_get_file_history(self):
|
def test_get_file_history(self):
|
||||||
with self.get_tmp_repo() as repo:
|
with self.get_tmp_repo() as repo:
|
||||||
|
Reference in New Issue
Block a user