1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 14:21:23 +00:00

[api2] Fix some bugs

1. user last message timestamp
2. user messages while none
This commit is contained in:
poetwang
2014-04-17 10:56:31 +08:00
parent 416f42e064
commit f0de19eb58
2 changed files with 3 additions and 4 deletions

View File

@@ -197,8 +197,8 @@ def get_group_and_contacts(email):
group_json.append(group) group_json.append(group)
for contact in contacts: for contact in contacts:
msg = UserMessage.objects.get_messages_related_to_user( msg = UserMessage.objects.get_messages_between_users(
contact).order_by('-timestamp')[:1] contact, email).order_by('-timestamp')[:1]
mtime = 0 mtime = 0
if len(msg) >= 1: if len(msg) >= 1:
mtime = get_timestamp(msg[0].timestamp) mtime = get_timestamp(msg[0].timestamp)

View File

@@ -2632,8 +2632,7 @@ class UserMsgsView(APIView):
'to_email' : to_email, 'to_email' : to_email,
'next_page' : next_page, 'next_page' : next_page,
'msgs' : [],}) 'msgs' : [],})
elif person_msgs.has_next():
if person_msgs.has_next():
next_page = person_msgs.next_page_number() next_page = person_msgs.next_page_number()
msgs = [] msgs = []