diff --git a/ckanext/harvest/templates_new/snippets/source_item.html b/ckanext/harvest/templates_new/snippets/source_item.html index 200d90f..18f7b6e 100644 --- a/ckanext/harvest/templates_new/snippets/source_item.html +++ b/ckanext/harvest/templates_new/snippets/source_item.html @@ -38,7 +38,9 @@ Example: {% endif %}

- {{ _('Datasets') }}: {{ source.status.total_datasets }} + {% if source.status %} + {{ _('Datasets') }}: {{ source.status.total_datasets }} + {% endif %} {% if not within_organization and source.organization %} — {{ _('Organization') }}: {{ h.link_to(source.organization.title or source.organization.name, h.url_for('organization_read', id=source.organization.name)) }} {% endif %} diff --git a/ckanext/harvest/templates_new/source/admin.html b/ckanext/harvest/templates_new/source/admin.html index 95a6cbc..a2ee908 100644 --- a/ckanext/harvest/templates_new/source/admin.html +++ b/ckanext/harvest/templates_new/source/admin.html @@ -3,7 +3,7 @@ {% block primary_content_inner %}

Last Harvest Job

- {% if source.status.last_job %} + {% if source.status and source.status.last_job %} {% snippet "snippets/job_details.html", job=source.status.last_job %}
diff --git a/ckanext/harvest/templates_new/source/admin_base.html b/ckanext/harvest/templates_new/source/admin_base.html index 94fdf69..6878700 100644 --- a/ckanext/harvest/templates_new/source/admin_base.html +++ b/ckanext/harvest/templates_new/source/admin_base.html @@ -8,7 +8,7 @@ {% endblock %} {% block actions_content %} - {% if source.status.last_job and (source.status.last_job.status == 'New' or source.status.last_job.status == 'Running') %} + {% if source.status and source.status.last_job and (source.status.last_job.status == 'New' or source.status.last_job.status == 'Running') %}
  • Reharvest
  • {% else %} {% set locale = h.dump_json({'content': _('This will re-run the harvesting for this source. Any updates at the source will overwrite the local datasets. Sources with a large number of datasets may take a significant amount of time to finish harvesting. Please confirm you would like us to start reharvesting.')}) %} diff --git a/ckanext/harvest/templates_new/source/read_base.html b/ckanext/harvest/templates_new/source/read_base.html index 9e48e1d..1abcc19 100644 --- a/ckanext/harvest/templates_new/source/read_base.html +++ b/ckanext/harvest/templates_new/source/read_base.html @@ -21,8 +21,15 @@ {% endif %}
    -
    {{ _('Datasets') }}
    -
    {{ c.harvest_source.status.total_datasets }}
    +
    + {{ _('Datasets') }} +
    + +
    + {% if c.harvest_source.status %} + {{ c.harvest_source.status.total_datasets }} + {% endif %} +