(verified_contact, text, msg)
return True
top-level handler for incoming stock report messages
top-level handler for incoming stock report messages
top - level handler for incoming stock report messages
def handle(verified_contact, text, msg):
    """top-level handler for incoming stock report messages"""
    domain_obj = Domain.get_by_name(verified_contact.domain)
    if not domain_obj.commtrack_enabled:
        return False

    try:
        data = StockReportParser(domain_obj, verified_contact).parse(text.lower())
        if not data:
            return False
    except NotAUserClassError:
        return False
    except Exception as e:
        if settings.UNIT_TESTING or settings.DEBUG:
            raise
        send_sms_to_verified_number(verified_contact, 'problem with stock report: %s' % str(e))
        return True

    process(domain_obj.name, data)
    send_confirmation(verified_contact, data)
    return True
def handle ( verified_contact , text , msg ) : domain_obj = Domain . get_by_name ( verified_contact . domain ) if not domain_obj . commtrack_enabled : return False try : data = StockReportParser ( domain_obj , verified_contact ) . parse ( text . lower ( ) ) if not data : return False except NotAUserClassError : return False except Exception as e : if settings . UNIT_TESTING or settings . DEBUG : raise send_sms_to_verified_number ( verified_contact , 'problem with stock report: %s' % str ( e ) ) return True process ( domain_obj . name , data ) send_confirmation ( verified_contact , data ) return True