def dispatch(self, request, *args, **kwargs):
ids = request.GET.get('<STR_LIT>')<EOL>groups = request.GET.get('<STR_LIT>')<EOL>self.customers = None<EOL>if ids or groups:<EOL><INDENT>filters = Q(id__isnull=True)<EOL>if ids:<EOL><INDENT>filters = filters | Q(id__in=[int(x) for x in ids.split('<STR_LIT:U+002C>')])<EOL><DEDENT>if groups:<EOL><INDENT>filters = filters | Q(groups__id__in=[int(x) for x in groups.split('<STR_LIT:U+002C>')])<EOL><DEDENT>try:<EOL><INDENT>self.customers = Customer.objects.filter(filters)<EOL><DEDENT>except ValueError:<EOL><INDENT>return HttpResponseBadRequest(_('<STR_LIT>'))<EOL><DEDENT><DEDENT>return super(SendEmailView, self).dispatch(request, *args, **kwargs)<EOL>
If a list of customers or groups was passed, then parse it