Change status code of 'AA not assigned to group'
This commit is contained in:
@@ -59,7 +59,7 @@ def unassign_accessauth(*, db: Session = Depends(get_session), group_id: int, aa
|
||||
if db_aa is None:
|
||||
raise HTTPException(status_code=404, detail="AA not found")
|
||||
if db_aa not in db_group.accessauths:
|
||||
raise HTTPException(status_code=200, detail="AA not assigned to group")
|
||||
raise HTTPException(status_code=404, detail="AA not assigned to group")
|
||||
db_group.accessauths.remove(db_aa)
|
||||
return add_and_refresh(db, db_group)
|
||||
|
||||
|
||||
@@ -99,8 +99,7 @@ def test_unassign_nonexistent_assignment(client, auth_headers, test_group, test_
|
||||
f"/aa/unassign/{test_group.id}/{test_aa.id}",
|
||||
headers=auth_headers
|
||||
)
|
||||
# According to the code, this returns 200 with "not assigned" message
|
||||
assert response.status_code == 200
|
||||
assert response.status_code == 404
|
||||
|
||||
|
||||
def test_assign_to_nonexistent_group(client, auth_headers, test_aa):
|
||||
|
||||
Reference in New Issue
Block a user