Skip to content

Commit

Permalink
[Fixres GeoNode#8690] fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Feb 8, 2022
1 parent 0b2b01c commit 5e07b4f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit 5e07b4f

Please sign in to comment.