Skip to content

Commit 9fe3ca8

Browse files
committed
cove_360.views: Custom msg for conversion warnings about publisher field
Depends on: OpenDataServices/flatten-tool#389 OpenDataServices/lib-cove#91
1 parent 12e58e2 commit 9fe3ca8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cove/cove_360/views.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,15 @@ def explore_360(request, pk, template='cove_360/explore.html'):
6565
lib_cove_config=lib_cove_config))
6666

6767
else:
68+
def conversion_warning_hook(w):
69+
if hasattr(w.message, "path_till_now"):
70+
if w.message.path_till_now == "publisher":
71+
return 'Just "Publisher" should not appear in the Meta tab, did you mean "Publisher:Name"?'
72+
else:
73+
return w
74+
6875
context.update(convert_spreadsheet(upload_dir, upload_url, file_name, file_type, lib_cove_config, schema_360.schema_url,
69-
schema_360.pkg_schema_url))
76+
schema_360.pkg_schema_url, conversion_warning_hook=conversion_warning_hook))
7077
with open(context['converted_path'], encoding='utf-8') as fp:
7178
json_data = json.load(fp, parse_float=Decimal)
7279

0 commit comments

Comments
 (0)