'Add a credential
:param username:    T411 username
:param password:    T411 password
:return:    False if username still has an entry (password has been updated)'

@with_session
def add_credential(self, username, password, session=None):

    credential = session.query(Credential).filter((Credential.username == username)).first()
    if credential:
        credential.password = password
        credential.api_token = None
        result = False
    else:
        credential = Credential(username=username, password=password)
        session.add(credential)
        result = True
    session.commit()
    return result
