def update_fs_approver(affected_admin):
    user_fs = UserFlowSpace.objects.filter(approver=affected_admin)
    for fs in user_fs:
        approver = find_supervisor([fs])
        if approver == None:
            raise Exception("When updating approver for userflowspace objects, find_supervisor returned None")
        fs.approver = approver
        fs.save()
        
    user_fs_req = RequestedUserFlowSpace.objects.filter(admin=affected_admin)
    for fs in user_fs_req:
        approver = find_supervisor([fs])
        if approver == None:
            raise Exception("When updating approver for RequestedUserFlowSpace objects, find_supervisor returned None")
        fs.admin = approver
        fs.save()
Flushes the buffer if certain conditions have been met.
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/admin_manager/helper.py/update_fs_approver--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/logservice/logservice.py/LogsBuffer.autoflush