def get(self, request, *args, **kwargs): super(BulkLicenceRenewalPDFView, self).get(request, *args, **kwargs) licences = [] if self.qs: licences = self.qs response = HttpResponse(content_type='application/pdf') response.write(bulk_licence_renewal_pdf_bytes(licences, request.build_absolute_uri(reverse('home')))) return response
def post(self, request, *args, **kwargs): query = request.POST.get('query') licences = [] if query: licences = WildlifeLicence.objects.filter(query) filename = 'bulk-renewals.pdf' response = HttpResponse(content_type='application/pdf') response.write(bulk_licence_renewal_pdf_bytes(licences, request.build_absolute_uri(reverse('home')))) return response
def get(self, request, *args, **kwargs): super(BulkLicenceRenewalPDFView, self).get(request, *args, **kwargs) licences = WildlifeLicence.objects.none() if self.qs: licences = self.qs response = HttpResponse(content_type='application/pdf') response.write(bulk_licence_renewal_pdf_bytes(licences, request.build_absolute_uri(reverse('home')))) if licences: licences.update(renewal_sent=True) return response
def get(self, request, *args, **kwargs): super(BulkLicenceRenewalPDFView, self).get(request, *args, **kwargs) licences = [] if self.qs: licences = self.qs response = HttpResponse(content_type='application/pdf') response.write( bulk_licence_renewal_pdf_bytes( licences, request.build_absolute_uri(reverse('home')))) return response
def post(self, request, *args, **kwargs): query = request.POST.get('query') licences = [] if query: licences = WildlifeLicence.objects.filter(query) filename = 'bulk-renewals.pdf' response = HttpResponse(content_type='application/pdf') response.write( bulk_licence_renewal_pdf_bytes( licences, request.build_absolute_uri(reverse('home')))) return response
def get(self, request, *args, **kwargs): super(BulkLicenceRenewalPDFView, self).get(request, *args, **kwargs) licences = WildlifeLicence.objects.none() if self.qs: licences = self.qs response = HttpResponse(content_type='application/pdf') response.write( bulk_licence_renewal_pdf_bytes( licences, request.build_absolute_uri(reverse('home')))) if licences: licences.update(renewal_sent=True) return response