'Returns any outstanding user messages.
Note: this function also marks these messages as being complete
so they won\'t be returned in the next request.'

@classmethod
def user_messages(self, request):

    def _get_message_type_for_level(level):
        '\n                                                Returns    the    user    message    type    associated    with    a    level.\n                                                '
        for (__, type) in UserMessageType.__members__.items():
            if (type.value is level):
                return type
        raise 'Unable    to    find    UserMessageType    for    level    {level}'.format(level=level)
    def _create_user_message(message):
        '\n                                                Creates    a    user    message    from    a    Django    message.\n                                                '
        return UserMessage(type=_get_message_type_for_level(message.level), message_html=unicode(message.message))
    django_messages = messages.get_messages(request)
    return (_create_user_message(message) for message in django_messages if (self.get_namespace() in message.tags))
