fix last message bug
This commit is contained in:
parent
557f745849
commit
b9273e1f5d
Binary file not shown.
|
@ -16,15 +16,9 @@ def last_messages(request):
|
||||||
return HttpResponse(status=405)
|
return HttpResponse(status=405)
|
||||||
id = request.user.id
|
id = request.user.id
|
||||||
group_id = request.GET.get('group_id')
|
group_id = request.GET.get('group_id')
|
||||||
messages = Message.objects.filter(send_to_id=group_id)[:100]
|
messages = reversed(Message.objects.filter(send_to_id=group_id).order_by('-added')[:100])
|
||||||
results = []
|
results = []
|
||||||
filter_dict = dict()
|
|
||||||
for m in messages:
|
|
||||||
if m.type == 4 or m.type == 1:
|
|
||||||
task_id = m.task_id
|
|
||||||
if task_id:
|
|
||||||
if task_id in filter_dict:
|
|
||||||
c = filter_dict[task_id]
|
|
||||||
for o in messages:
|
for o in messages:
|
||||||
result = dict()
|
result = dict()
|
||||||
t = o.type
|
t = o.type
|
||||||
|
|
Loading…
Reference in New Issue