I have the following code:
def _demo_preview_message(request):
if not getattr(settings, 'IS_DEMO', False):
return
last = DemoEmail.objects.order_by('-id').first()
if last:
messages.success(
request=request,
message=format_html("Email queued (demo). <a href='{}'>Preview</a>",
reverse('demo_outbox_detail', args=[last.pk]))
)
At the line:
message=format_html("Email queued (demo). <a href='{}'>Preview</a>",
reverse('demo_outbox_detail', args=[last.pk]))
PyCharm gives me the following message:
Calling format_html() without passing args or kwargs is deprecated.
How can I fix this?
Later edit:
format_htmlSeems to be a code analysis issue from PyCharms side so no need to fix this if everything works fine when ran.
If this really bothers you, you could maybe disable it in pycharm: Preferences -> Editor -> Inspections