Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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