Skip to content

Commit dc7f227

Browse files
committed
[#2912] Fix styling for zgw import-export error messages
1 parent e589b3a commit dc7f227

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/open_inwoner/openzaak/admin.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,13 @@ def process_file_view(self, request):
190190
error_msg_iterator = ([msg] for msg in msgs_deduped)
191191

192192
error_msg_html = format_html_join(
193-
"\n", "<li>{}</li>", error_msg_iterator
193+
"\n", "<p> - {}</p>", error_msg_iterator
194194
)
195-
error_msg_html_ordered = format_html(
195+
error_msg_html = format_html(
196196
_("It was not possible to import the following items:")
197-
+ f"<ol> {error_msg_html} </ol>"
198-
)
199-
self.message_user(
200-
request, error_msg_html_ordered, messages.ERROR
197+
+ f"<div>{error_msg_html}</div>"
201198
)
199+
self.message_user(request, error_msg_html, messages.ERROR)
202200

203201
return HttpResponseRedirect(
204202
reverse(

src/open_inwoner/openzaak/import_export.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@ def extract_error_data(cls, exc: Exception, jsonl: str):
4343
fields = data.get("fields", None)
4444
if source_config is CatalogusConfig:
4545
items = [
46-
f"Domein = {fields['domein']}",
47-
f"Rsin = {fields['rsin']}",
46+
f"Domein = {fields['domein']!r}",
47+
f"Rsin = {fields['rsin']!r}",
4848
]
4949
if source_config is ZaakTypeConfig:
5050
items = [
51-
f"Identificatie = {fields['identificatie']}",
52-
f"Catalogus domein = {fields['catalogus'][0]}",
53-
f"Catalogus rsin = {fields['catalogus'][1]}",
51+
f"Identificatie = {fields['identificatie']!r}",
52+
f"Catalogus domein = {fields['catalogus'][0]!r}",
53+
f"Catalogus rsin = {fields['catalogus'][1]!r}",
5454
]
5555
if source_config in {
5656
ZaakTypeStatusTypeConfig,
5757
ZaakTypeResultaatTypeConfig,
5858
ZaakTypeInformatieObjectTypeConfig,
5959
}:
6060
items = [
61-
f"omschrijving = {fields['omschrijving']}",
62-
f"ZaakTypeConfig identificatie = {fields['zaaktype_config'][0]}",
63-
f"Catalogus domein = {fields['zaaktype_config'][1]}",
64-
f"Catalogus rsin = {fields['zaaktype_config'][2]}",
61+
f"omschrijving = {fields['omschrijving']!r}",
62+
f"ZaakTypeConfig identificatie = {fields['zaaktype_config'][0]!r}",
63+
f"Catalogus domein = {fields['zaaktype_config'][1]!r}",
64+
f"Catalogus rsin = {fields['zaaktype_config'][2]!r}",
6565
]
6666

6767
return {

0 commit comments

Comments
 (0)