From c008e5476e848999aff2f6a3f7156ddabe67784b Mon Sep 17 00:00:00 2001 From: Deep-NEC <104511248+Deep-NEC@users.noreply.github.com> Date: Mon, 11 Jul 2022 14:15:53 +0530 Subject: [PATCH] Warning for PDF Files when pushed via datapusher --- datapusher/jobs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datapusher/jobs.py b/datapusher/jobs.py index 76828b7..f913e0b 100644 --- a/datapusher/jobs.py +++ b/datapusher/jobs.py @@ -393,6 +393,9 @@ def push_to_datastore(task_id, input, dry_run=False): m.update(chunk) ct = response.headers.get('content-type', '').split(';', 1)[0] + + if ct == 'application/pdf': + raise util.JobError('Pdf file is detected. DataPusher cannot Push Pdf file to DataStore') except requests.HTTPError as e: raise HTTPError(