def raw_username(username):
    sitewide_domain = settings.HQ_ACCOUNT_ROOT 
    username = username.lower()
    try:
        u, d = username.split("@")
    except Exception:
        return username
    if d.endswith('.' + sitewide_domain):
        return u
    else:
        return username
Run a raw update against the base query.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/users/util.py/raw_username--crossover with--dataset/ETHPy150Open sdispater/orator/orator/orm/relations/relation.py/Relation.raw_update