few renames
This commit is contained in:
parent
bca5b2b55c
commit
c0388d58c1
1 changed files with 3 additions and 3 deletions
|
@ -90,19 +90,19 @@ async def remove_device(
|
||||||
},
|
},
|
||||||
response_model=DeviceRead,
|
response_model=DeviceRead,
|
||||||
)
|
)
|
||||||
async def request_certificate(
|
async def request_certificate_issuance(
|
||||||
current_user: User = Depends(get_current_user),
|
current_user: User = Depends(get_current_user),
|
||||||
device: Device = Depends(get_device_by_id),
|
device: Device = Depends(get_device_by_id),
|
||||||
) -> Device:
|
) -> Device:
|
||||||
"""
|
"""
|
||||||
POST ./{device_id}/issue: Request certificate for a device.
|
POST ./{device_id}/issue: Request certificate issuance for a device.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# check permission
|
# check permission
|
||||||
if not current_user.can_edit(device):
|
if not current_user.can_edit(device):
|
||||||
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN)
|
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN)
|
||||||
|
|
||||||
# cannot request for a newly created device
|
# can only request for a newly created device
|
||||||
if device.approved is not None:
|
if device.approved is not None:
|
||||||
raise HTTPException(status_code=status.HTTP_409_CONFLICT)
|
raise HTTPException(status_code=status.HTTP_409_CONFLICT)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue