How can I fix the "Calling format_html() without passing args or kwargs is deprecated." in PyCharm?

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?

Вернуться на верх