remove pdf/png code from admin app entirely

while PDFs work on paas, they only do that because it turns out the
python buildpack happens to have imagemagick preinstalled - if that
ever changes then it'd break. so move those to the template preview
service. This also means we can get rid of weazyprint and wand
dependencies
This commit is contained in:
Leo Hemsted
2017-04-10 17:25:08 +01:00
parent 64d162d96e
commit a6318f2674
5 changed files with 42 additions and 113 deletions

View File

@@ -16,8 +16,6 @@ from flask import (
)
from flask_login import current_user
from wand.image import Image
from notifications_utils.template import (
SMSPreviewTemplate,
EmailPreviewTemplate,
@@ -327,21 +325,6 @@ def get_template(
)
def png_from_pdf(pdf_endpoint):
output = BytesIO()
with Image(
blob=pdf_endpoint.get_data(),
resolution=150,
) as image:
with image.convert('png') as converted:
converted.save(file=output)
output.seek(0)
return dict(
filename_or_fp=output,
mimetype='image/png',
)
def get_current_financial_year():
now = datetime.utcnow()
current_month = int(now.strftime('%-m'))