]> git.parisson.com Git - teleforma.git/commitdiff
postman : also search in recipient name
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 5 Jun 2024 13:44:00 +0000 (15:44 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 5 Jun 2024 13:44:00 +0000 (15:44 +0200)
teleforma/postman.py

index 67cabdb75e53e1694cff5dc8d0a5b940662e6072..7a9b5b8f2c42f715d8c68f33bff202d90bf96db1 100644 (file)
@@ -33,7 +33,9 @@ def _folder(self, related, filters, option=None, order_by=None, query_dict=None)
                 | models.Q(body__icontains=search)\
                 | models.Q(sender__username__icontains=search)\
                 | models.Q(sender__first_name__icontains=search)\
-                | models.Q(sender__last_name__icontains=search)
+                | models.Q(sender__last_name__icontains=search)\
+                | models.Q(recipient__first_name__icontains=search)\
+                | models.Q(recipient__last_name__icontains=search)
     if option == OPTION_MESSAGES:
         qs = qs.filter(lookups)
         # Adding a 'count' attribute, to be similar to the by-conversation case,