adding traceback for metadata form generation as part of migration command
import json
import logging
+import sys
+import traceback
import jsonschema
from django.core.management.base import BaseCommand
@@ -255,6 +257,23 @@ class Command(BaseCommand):
msg = msg.format(comp_res.short_id, str(err))
logger.error(msg)
self.stdout.write(self.style.ERROR(msg))
+ try:
+ mi_aggr.metadata.get_html()
+ except Exception as err:
+ traceback.print_exception(*sys.exc_info())
+ msg = 'Failed to generate modflow aggregation metadata for view for resource (ID:{}). Error:{}'
+ msg = msg.format(comp_res.short_id, str(err))
+ logger.error(msg)
+ self.stdout.write(self.style.ERROR(msg))
+
+ try:
+ mi_aggr.metadata.get_html_forms()
+ except Exception as err:
+ traceback.print_exception(*sys.exc_info())
+ msg = 'Failed to generate modflow aggregation metadata for edit for resource (ID:{}). Error:{}'
+ msg = msg.format(comp_res.short_id, str(err))
+ logger.error(msg)
+ self.stdout.write(self.style.ERROR(msg))
mi_aggr.set_metadata_dirty()
msg = 'One model instance aggregation was created in resource (ID:{})'
