add exception message
This commit is contained in:
@@ -185,14 +185,18 @@ class BillAdmin(admin.ModelAdmin):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return "-"
|
return "-"
|
||||||
|
|
||||||
qrcode = helpers.make_epc_qr(
|
try:
|
||||||
name=tmp.name,
|
qrcode = helpers.make_epc_qr(
|
||||||
iban=tmp.iban,
|
name=tmp.name,
|
||||||
amount=obj.amount,
|
iban=tmp.iban,
|
||||||
text=obj.purpose,
|
amount=obj.amount,
|
||||||
bic=tmp.bic,
|
text=obj.purpose,
|
||||||
encoding="utf-8",
|
bic=tmp.bic,
|
||||||
)
|
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