few renames

This commit is contained in:
Jörn-Michael Miehe 2022-04-05 22:34:25 +00:00
parent bca5b2b55c
commit c0388d58c1

View file

@ -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)