

@quickcache(['user_id'], timeout=ONE_DAY)
def get_user_type(user_id):
    if (user_id == SYSTEM_USER_ID):
        return SYSTEM_USER_TYPE
    elif (user_id == DEMO_USER_ID):
        return DEMO_USER_TYPE
    elif (user_id == COMMTRACK_USERNAME):
        return COMMCARE_SUPPLY_USER_TYPE
    else:
        try:
            user = CouchUser.get(user_id)
            if user.is_web_user():
                return WEB_USER_TYPE
            elif user.is_commcare_user():
                return MOBILE_USER_TYPE
        except:
            pass
    return UNKNOWN_USER_TYPE

dataset/ETHPy150Open dimagi/commcare-hq/corehq/pillows/utils.py get_user_type/original