diff --git a/ckanext/odsh/lib/uploader.py b/ckanext/odsh/lib/uploader.py index fa338656771af5b186f4425b9241f6ba31d74909..65def18c25e1db0adc2ee66bb3e3364dbb5689a1 100644 --- a/ckanext/odsh/lib/uploader.py +++ b/ckanext/odsh/lib/uploader.py @@ -29,6 +29,7 @@ def raise_validation_error_if_virus_found(filename, upload_file): def calculate_hash(upload_file): + upload_file.seek(0) hash_md5 = hashlib.md5() for chunk in iter(lambda: upload_file.read(4096), b""): hash_md5.update(chunk) @@ -41,6 +42,8 @@ def _raise_validation_error_if_hash_values_differ(upload_file, resource): if hash_from_resource: hash_from_calculation = calculate_hash(upload_file) if not hash_from_calculation == hash_from_resource: + log.debug('hash from calculation: {}'.format(hash_from_calculation)) + log.debug('hash from resource: {}'.format(hash_from_resource)) raise logic.ValidationError({'upload': ['Berechneter Hash und mitgelieferter Hash sind unterschiedlich']}) diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 3dfc22ab246746e60cb7c1f9cc232f779e5e7e66..a97dcbeaf1bc4cd7aeff64a118111b4c283bccc3 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -111,7 +111,6 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm schema['extras'].update({ 'key': [ toolkit.get_converter('known_spatial_uri'), - toolkit.get_converter('validate_licenseAttributionByText'), ] }) schema.update(