add exception message
This commit is contained in:
@@ -185,6 +185,7 @@ class BillAdmin(admin.ModelAdmin):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return "-"
|
return "-"
|
||||||
|
|
||||||
|
try:
|
||||||
qrcode = helpers.make_epc_qr(
|
qrcode = helpers.make_epc_qr(
|
||||||
name=tmp.name,
|
name=tmp.name,
|
||||||
iban=tmp.iban,
|
iban=tmp.iban,
|
||||||
@@ -193,6 +194,9 @@ class BillAdmin(admin.ModelAdmin):
|
|||||||
bic=tmp.bic,
|
bic=tmp.bic,
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
|
except Exception:
|
||||||
|
return "Daten für QR Code ungültig"
|
||||||
|
|
||||||
uri = qrcode.png_data_uri(scale=3.0)
|
uri = qrcode.png_data_uri(scale=3.0)
|
||||||
return format_html(f'<img src="{uri}">')
|
return format_html(f'<img src="{uri}">')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user