@register.filter()<EOL>def messages(obj):
if isinstance(obj, BaseForm):<EOL><INDENT>return obj.non_field_errors()<EOL><DEDENT>return get_messages(obj)<EOL>
Messages to be displayed to the current session.