Esempio n. 1
0
    def submit(self, request, idx):
        """Submit the multi request"""
        # pylint: disable=no-self-use

        get_object_or_404(FOIAMultiRequest, pk=idx)
        submit_multi_request.apply_async(args=[idx])

        messages.info(request, 'Multi request is being submitted...')
        return HttpResponseRedirect(reverse('admin:foia_foiamultirequest_changelist'))
Esempio n. 2
0
 def submit(self, agency_list):
     """Submit the multirequest"""
     from muckrock.foia.tasks import submit_multi_request
     return_requests = 0
     for agency in self.multirequest.agencies.all():
         if str(agency.pk) not in agency_list:
             self.multirequest.agencies.remove(agency)
             return_requests += 1
     self.multirequest.save()
     self._return_requests(return_requests)
     submit_multi_request.apply_async(args=(self.multirequest.pk, ))