filter on id

This commit is contained in:
Ludovic Stephan 2016-12-09 17:29:40 -02:00
parent b3b49d5768
commit 85af7fe485

View file

@ -1282,12 +1282,13 @@ def history_json(request):
transfer_queryset_prefetch = Transfer.objects.select_related(
'from_acc__trigramme', 'to_acc__trigramme',
'from_acc__id', 'to_acc__id',
'canceled_by__trigramme')
if accounts:
transfer_queryset_prefetch = transfer_queryset_prefetch.filter(
Q(from_acc__trigramme__in=accounts) |
Q(to_acc__trigramme__in=accounts))
Q(from_acc__id__in=accounts) |
Q(to_acc__id__in=accounts))
if not request.user.has_perm('kfet.is_team'):
acc = request.user.profile.account_kfet