for comb in combs:
- # qf c'est pour trouver les recipients.
- qf = reduce(
- lambda x, y: x & y,
- [Q(**{'changement_notifications__type': t}) for t in comb]
- )
- recipients = recipient_list.filter(qf)
+
+ recipients = ref.Employe.objects.none()
+ for t in comb:
+ recipients = recipient_list.filter(changement_notifications__type=t)
recipient_list = recipient_list.exclude(
id__in=recipients.values_list('id', flat=True))
types_dict = dict(rh.TYPES_CHANGEMENT)
+
if len(recipients):
ctx = {
'types': [
for ch in qs.filter(type__in=[t]):
changements.append(ch)
-
template = loader.get_template('email/mouvement_employe.html')
content = template.render(Context(ctx))