From 5e07b4fb1f970b75615e18ac0dc5cfd150627fbc Mon Sep 17 00:00:00 2001 From: mattiagiupponi Date: Tue, 8 Feb 2022 09:29:25 +0100 Subject: [PATCH] [Fixres #8690] fix broken test --- geonode/layers/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/geonode/layers/views.py b/geonode/layers/views.py index d42680b399a..412fcad7eea 100644 --- a/geonode/layers/views.py +++ b/geonode/layers/views.py @@ -533,8 +533,7 @@ def dataset_metadata( logger.error(f"Dataset Metadata form is not valid: {dataset_form.errors}") out = { 'success': False, - 'errors': [ - re.sub(re.compile('<.*?>'), '', str(err)) for err in dataset_form.errors] + 'errors': [f"{x}: {y[0].messages[0]}" for x, y in dataset_form.errors.as_data().items()] } return HttpResponse( json.dumps(out), @@ -551,7 +550,7 @@ def dataset_metadata( logger.error(f"Dataset Attributes form is not valid: {attribute_form.errors}") out = { 'success': False, - "errors": [f"{x}: {y[0].messages[0]}" for x, y in attribute_form.errors.as_data().items()] + "errors": [re.sub(re.compile('<.*?>'), '', str(err)) for err in attribute_form.errors] } return HttpResponse( json.dumps(out),