add exception message

This commit is contained in:
2024-01-07 12:20:37 +00:00
parent 8073215888
commit fee676d0c5

View File

@@ -185,14 +185,18 @@ class BillAdmin(admin.ModelAdmin):
except Exception:
return "-"
qrcode = helpers.make_epc_qr(
name=tmp.name,
iban=tmp.iban,
amount=obj.amount,
text=obj.purpose,
bic=tmp.bic,
encoding="utf-8",
)
try:
qrcode = helpers.make_epc_qr(
name=tmp.name,
iban=tmp.iban,
amount=obj.amount,
text=obj.purpose,
bic=tmp.bic,
encoding="utf-8",
)
except Exception:
return "Daten für QR Code ungültig"
uri = qrcode.png_data_uri(scale=3.0)
return format_html(f'<img src="{uri}">')