Пример #1
0
def get_current_user():
    user_id = session.get("user_id")
    if user_id:
        return Users.get(user_id)
    else:
        return False
Пример #2
0
def test_get_nonexistent_user():
    with pytest.raises(NotFoundError):
        Users.get(uuid4())
Пример #3
0
def remove_access(user_id):
    user = Users.get(user_id)
    Users.revoke_ccpo_perms(user)
    flash("ccpo_user_removed", user_name=user.full_name)
    return redirect(url_for("ccpo.users"))
Пример #4
0
def test_get_user():
    new_user = UserFactory.create()
    user = Users.get(new_user.id)
    assert user.id == new_user.id