alfortville: pass all required criterias when giving avis (#11087)
This commit is contained in:
parent
7c34b60fc3
commit
81b92243c8
|
@ -198,8 +198,15 @@ class MailTable(TemplateView):
|
|||
return context
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
Inbox.objects.filter(source_pk__in=request.POST.getlist('object-pk')).update(done=True,
|
||||
comments=request.POST.get('comments'))
|
||||
user_roles = [x.uuid for x in Role.objects.filter(user=self.request.user)]
|
||||
content_type = ContentType.objects.get_for_model(Mail)
|
||||
Inbox.objects.filter(
|
||||
source_type=content_type,
|
||||
source_pk__in=request.POST.getlist('object-pk'),
|
||||
role_slug__in=user_roles,
|
||||
subtype=self.subtype).update(
|
||||
done=True,
|
||||
comments=request.POST.get('comments'))
|
||||
return HttpResponseRedirect('.')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue