def record_locked_by_other_user(recid, uid): """Return true if any other user than UID has active caches for record RECID. """ active_uids = uids_with_active_caches(recid) try: active_uids.remove(uid) except ValueError: pass return bool(active_uids)
def record_locked_by_user_details(recid, uid): """ Get the details about the user that has locked a record and the time the record has been locked. @return: user details and time when record was locked @rtype: tuple """ active_uids = uids_with_active_caches(recid) try: active_uids.remove(uid) except ValueError: pass record_blocked_by_nickname = record_blocked_by_email = locked_since = "" if active_uids: record_blocked_by_uid = active_uids[0] record_blocked_by_nickname = get_user_info(record_blocked_by_uid)[1] record_blocked_by_email = get_email(record_blocked_by_uid) locked_since = get_record_locked_since(recid, record_blocked_by_uid) return record_blocked_by_nickname, record_blocked_by_email, locked_since