mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
return owner name and contact email when get mine/shared repo list
This commit is contained in:
@@ -608,6 +608,8 @@ class Repos(APIView):
|
|||||||
filter_by[f] = True
|
filter_by[f] = True
|
||||||
|
|
||||||
email = request.user.username
|
email = request.user.username
|
||||||
|
owner_name = email2nickname(email)
|
||||||
|
owner_contact_email = email2contact_email(email)
|
||||||
|
|
||||||
# Use dict to reduce memcache fetch cost in large for-loop.
|
# Use dict to reduce memcache fetch cost in large for-loop.
|
||||||
contact_email_dict = {}
|
contact_email_dict = {}
|
||||||
@@ -644,6 +646,8 @@ class Repos(APIView):
|
|||||||
"type": "repo",
|
"type": "repo",
|
||||||
"id": r.id,
|
"id": r.id,
|
||||||
"owner": email,
|
"owner": email,
|
||||||
|
"owner_name": owner_name,
|
||||||
|
"owner_contact_email": owner_contact_email,
|
||||||
"name": r.name,
|
"name": r.name,
|
||||||
"mtime": r.last_modify,
|
"mtime": r.last_modify,
|
||||||
"modifier_email": r.last_modifier,
|
"modifier_email": r.last_modifier,
|
||||||
@@ -697,6 +701,8 @@ class Repos(APIView):
|
|||||||
"type": "srepo",
|
"type": "srepo",
|
||||||
"id": r.repo_id,
|
"id": r.repo_id,
|
||||||
"owner": r.user,
|
"owner": r.user,
|
||||||
|
"owner_name": nickname_dict.get(r.user, ''),
|
||||||
|
"owner_contact_email": contact_email_dict.get(r.user, ''),
|
||||||
"name": r.repo_name,
|
"name": r.repo_name,
|
||||||
"owner_nickname": nickname_dict.get(r.user, ''),
|
"owner_nickname": nickname_dict.get(r.user, ''),
|
||||||
"mtime": r.last_modify,
|
"mtime": r.last_modify,
|
||||||
|
Reference in New Issue
Block a user