Fix group object access
This commit is contained in:
@ -94,7 +94,7 @@ def create_router(dependencies: AdminDependencies) -> APIRouter:
|
|||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_404_NOT_FOUND, detail="No such group."
|
status_code=status.HTTP_404_NOT_FOUND, detail="No such group."
|
||||||
)
|
)
|
||||||
return results[0]
|
return results.groups[0]
|
||||||
|
|
||||||
@app.post("/secrets/groups/")
|
@app.post("/secrets/groups/")
|
||||||
async def add_secret_group(
|
async def add_secret_group(
|
||||||
@ -125,7 +125,7 @@ def create_router(dependencies: AdminDependencies) -> APIRouter:
|
|||||||
Entries within the group will be moved to the root.
|
Entries within the group will be moved to the root.
|
||||||
This also includes nested entries further down from the group.
|
This also includes nested entries further down from the group.
|
||||||
"""
|
"""
|
||||||
group = await admin.get_secret_group(group.name)
|
group = await admin.get_secret_group(group_name)
|
||||||
if not group:
|
if not group:
|
||||||
return
|
return
|
||||||
await admin.delete_secret_group(group_name, keep_entries=True)
|
await admin.delete_secret_group(group_name, keep_entries=True)
|
||||||
@ -196,7 +196,7 @@ def create_router(dependencies: AdminDependencies) -> APIRouter:
|
|||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_404_NOT_FOUND, detail="No such group."
|
status_code=status.HTTP_404_NOT_FOUND, detail="No such group."
|
||||||
)
|
)
|
||||||
group = groups[0]
|
group = groups.groups[0]
|
||||||
matching_entries = [
|
matching_entries = [
|
||||||
entry for entry in group.entries if entry.name == secret_name
|
entry for entry in group.entries if entry.name == secret_name
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user