From 457b8d59885e88d43bc2e81302650633d9d8e879 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 25 Feb 2013 12:49:14 +0000 Subject: [PATCH] [#7] 404 on last job if no jobs yet --- ckanext/harvest/controllers/view.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ckanext/harvest/controllers/view.py b/ckanext/harvest/controllers/view.py index 606abcb..9adaf69 100644 --- a/ckanext/harvest/controllers/view.py +++ b/ckanext/harvest/controllers/view.py @@ -348,6 +348,9 @@ class ViewController(BaseController): source_dict = self._get_source_for_job(source) + if not source_dict['status']['last_job']: + abort(404, _('No jobs yet for this source')) + return self.show_job(source_dict['status']['last_job']['id'], source_dict=source_dict, is_last=True)