mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 06:44:16 +00:00
[api2] Fix timestamp format
This commit is contained in:
@@ -118,7 +118,7 @@ def get_groups(email):
|
|||||||
msg = GroupMessage.objects.filter(group_id=g.id).order_by('-timestamp')[:1]
|
msg = GroupMessage.objects.filter(group_id=g.id).order_by('-timestamp')[:1]
|
||||||
mtime = 0
|
mtime = 0
|
||||||
if len(msg) >= 1:
|
if len(msg) >= 1:
|
||||||
mtime = int(time.mktime(msg[0].timestamp.timetuple()))
|
mtime = get_timestamp(msg[0].timestamp)
|
||||||
group = {
|
group = {
|
||||||
"id":g.id,
|
"id":g.id,
|
||||||
"name":g.group_name,
|
"name":g.group_name,
|
||||||
@@ -128,6 +128,7 @@ def get_groups(email):
|
|||||||
"msgnum":grpmsgs[g.id],
|
"msgnum":grpmsgs[g.id],
|
||||||
}
|
}
|
||||||
group_json.append(group)
|
group_json.append(group)
|
||||||
|
|
||||||
return group_json, replynum
|
return group_json, replynum
|
||||||
|
|
||||||
def get_msg_group_id(msg_id):
|
def get_msg_group_id(msg_id):
|
||||||
@@ -165,7 +166,7 @@ def get_group_and_contacts(email):
|
|||||||
replies[msg_id] = replies[msg_id] + 1
|
replies[msg_id] = replies[msg_id] + 1
|
||||||
else:
|
else:
|
||||||
replies[msg_id] = 1
|
replies[msg_id] = 1
|
||||||
d['mtime'] = n.timestamp
|
d['mtime'] = get_timestamp(n.timestamp)
|
||||||
d['name'] = email2nickname(d['reply_from'])
|
d['name'] = email2nickname(d['reply_from'])
|
||||||
d['group_id'] = get_msg_group_id(msg_id)
|
d['group_id'] = get_msg_group_id(msg_id)
|
||||||
replies_json.append(d)
|
replies_json.append(d)
|
||||||
@@ -182,7 +183,7 @@ def get_group_and_contacts(email):
|
|||||||
msg = GroupMessage.objects.filter(group_id=g.id).order_by('-timestamp')[:1]
|
msg = GroupMessage.objects.filter(group_id=g.id).order_by('-timestamp')[:1]
|
||||||
mtime = 0
|
mtime = 0
|
||||||
if len(msg) >= 1:
|
if len(msg) >= 1:
|
||||||
mtime = int(time.mktime(msg[0].timestamp.timetuple()))
|
mtime = get_timestamp(msg[0].timestamp)
|
||||||
group = {
|
group = {
|
||||||
"id":g.id,
|
"id":g.id,
|
||||||
"name":g.group_name,
|
"name":g.group_name,
|
||||||
@@ -200,7 +201,7 @@ def get_group_and_contacts(email):
|
|||||||
contact).order_by('-timestamp')[:1]
|
contact).order_by('-timestamp')[:1]
|
||||||
mtime = 0
|
mtime = 0
|
||||||
if len(msg) >= 1:
|
if len(msg) >= 1:
|
||||||
mtime = int(time.mktime(msg[0].timestamp.timetuple()))
|
mtime = get_timestamp(msg[0].timestamp)
|
||||||
c = {
|
c = {
|
||||||
'email' : contact,
|
'email' : contact,
|
||||||
'name' : email2nickname(contact),
|
'name' : email2nickname(contact),
|
||||||
|
Reference in New Issue
Block a user