alfortville: only remove copie roles for selected mail (#13309)

This commit is contained in:
Frédéric Péters 2016-09-26 15:21:35 +02:00
parent 8ea4c31c33
commit a09b17739b
1 changed files with 2 additions and 1 deletions

View File

@ -181,7 +181,8 @@ class Copies(DetailView):
Inbox.INFO: request.POST.getlist('info'),
}
for subtype in lists.keys():
Inbox.objects.filter(subtype=subtype).exclude(
Inbox.objects.filter(subtype=subtype).filter(
source_pk=kwargs['pk']).exclude(
role_slug__in=lists[subtype]).delete()
mail_content_type = ContentType.objects.get_for_model(Mail)
for subtype in lists.keys():