Skip to content

Commit

Permalink
Merge pull request #38 from Amsterdam/pre-release/3.1.2
Browse files Browse the repository at this point in the history
Pre release/3.1.2
  • Loading branch information
kramer65 authored Jun 12, 2020
2 parents f8b8a9e + bf8d8aa commit 67b885c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
20 changes: 10 additions & 10 deletions deploy/import/docker-import-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ set -x # log every command.
python manage.py migrate
# Do full import. Delete all data

if [ "$BOUWDOSSIERS_OBJECTSTORE_CONTAINER" = "dossiers_acceptance" ]
then
python manage.py run_import --delete --skip_validate_import --skipimport --skip_add_bag_ids
python manage.py run_import --skip_validate_import
python manage.py run_import --wabo --skip_validate_import --skip_add_bag_ids
else
python manage.py run_import --delete --skip_validate_import --skipimport --skip_add_bag_ids
python manage.py run_import --min_bouwdossiers_count ${MIN_BOUWDOSSIERS_COUNT}
python manage.py run_import --wabo --skip_add_bag_ids --min_bouwdossiers_count ${MIN_BOUWDOSSIERS_COUNT}
fi
#if [ "$BOUWDOSSIERS_OBJECTSTORE_CONTAINER" = "dossiers_acceptance" ]
#then
python manage.py run_import --delete --skip_validate_import --skipimport --skip_add_bag_ids
python manage.py run_import --skip_validate_import
python manage.py run_import --wabo --skip_validate_import --skip_add_bag_ids
#else
# python manage.py run_import --delete --skip_validate_import --skipimport --skip_add_bag_ids
# python manage.py run_import --min_bouwdossiers_count ${MIN_BOUWDOSSIERS_COUNT}
# python manage.py run_import --wabo --skip_add_bag_ids --min_bouwdossiers_count ${MIN_BOUWDOSSIERS_COUNT}
#fi
5 changes: 5 additions & 0 deletions src/bouwdossiers/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ def validate_import(min_bouwdossiers_count):
result['has_openbareruimte_id'] += row[0]
log.info('Validation import result: ' + str(result))

log.info(
f"{result['has_panden']} number of records of a total of {result['total']} records"
f" ({result['has_panden'] / result['total'] * 100}%) has one or more panden."
f" The required minimum is {0.8 * result['total']} (80%)."
)
assert result['total'] > min_bouwdossiers_count, \
f'Imported total of {result["total"]} bouwdossiers is less than the required number {min_bouwdossiers_count}'
assert result['has_panden'] > 0.8 * result['total'], \
Expand Down

0 comments on commit 67b885c

Please sign in to comment.