<commit_before>import rapidsms

from rapidsms.apps.base import AppBase
from .models import XForm

class App (AppBase):

    def handle (self, message):
        # see if this message matches any of our forms
        form = XForm.find_form(message.text)

        # if so, process it
        if form:
            submission = form.process_sms_submission(message)
            message.respond(submission.response)
            return True

        return False
        <commit_msg>extra validation so templates don't get returned as empty strings<commit_after>import rapidsms

from rapidsms.apps.base import AppBase
from .models import XForm

class App (AppBase):

    def handle (self, message):
        # see if this message matches any of our forms
        form = XForm.find_form(message.text)

        # if so, process it
        if form:
            submission = form.process_sms_submission(message)
            if submission.response == '':
                return True
            else:
                message.respond(submission.response)
                return True
        return False
        
{'fraction_non_alphanumeric': 0.06198723792160438, 'fraction_numerical': 0.0, 'mean_word_length': 2.0756302521008405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2845636', 'n_tokens_mistral': 289, 'n_tokens_neox': 281, 'n_words': 96}