Skip to content

Commit

Permalink
Merge pull request #86 from qld-gov-au/develop
Browse files Browse the repository at this point in the history
Develop to master - fix report page
  • Loading branch information
ThrawnCA authored Jan 15, 2025
2 parents 7f4a66e + 6076b25 commit 00b4a79
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile-template.ckan
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COPY bin/ckan_cli /usr/bin/

RUN chmod +x "${APP_DIR}"/bin/*.sh /usr/bin/ckan_cli

ENV DOCKERIZE_VERSION v0.9.1
ENV DOCKERIZE_VERSION=v0.9.1
# Install dependencies and dockerize based on the base image
RUN ARCH=$(uname -m); \
if [ -f /etc/alpine-release ]; then \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ jobs:
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
flags: "${{ matrix.ckan-version }}"
flags: "${{ matrix.ckan-version }}"
14 changes: 0 additions & 14 deletions bin/serve.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env sh
set -e

dockerize -wait tcp://postgres:5432 -timeout 1m
dockerize -wait tcp://solr:8983 -timeout 1m
dockerize -wait tcp://redis:6379 -timeout 1m

for i in `seq 1 60`; do
if (PGPASSWORD=pass psql -h postgres -U ckan_default -d ckan_test -c "\q"); then
echo "Database became ready on attempt $i"
break
else
echo "Database not yet ready, retrying (attempt $i)..."
sleep 1
fi
done

. "${APP_DIR}"/bin/activate
if (which ckan > /dev/null); then
ckan -c ${CKAN_INI} run --disable-reloader --threaded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1 class="page-heading">{{ h.resource_display_name(resource) | truncate(50) }}
<div class="validation-details">
<div>{{ _('Validation timestamp') }}: {{ h.render_datetime(resource.validation_timestamp, with_hours=True) }}</div>
{% if validation.report %}
<div>{{ _('Duration') }}: {{ validation.report.time }}s</div>
<div>{{ _('Duration') }}: {{ validation.report.time or validation.report.stats.seconds }}s</div>
{% endif %}
</div>

Expand Down
5 changes: 4 additions & 1 deletion ckanext/validation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,14 @@ def is_uploaded_file(upload):


def validation_dictize(validation):
report = validation.report
if not isinstance(report, dict):
report = json.loads(str(report))
out = {
'id': validation.id,
'resource_id': validation.resource_id,
'status': validation.status,
'report': validation.report,
'report': report,
'error': validation.error,
}
out['created'] = (validation.created.isoformat()
Expand Down
13 changes: 0 additions & 13 deletions test.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
#
# CKAN - Pylons configuration
#
# These are some of the configuration options available for your CKAN
# instance. Check the documentation in 'doc/configuration.rst' or at the
# following URL for a description of what they do and the full list of
# available options:
#
# http://docs.ckan.org/en/latest/maintaining/configuration.html
#
# The %(here)s variable will be replaced with the parent directory of this file
#

[DEFAULT]
debug = false
smtp_server = localhost
Expand Down

0 comments on commit 00b4a79

Please sign in to comment.