minor: ruff formatter
All changes are either: - Correcting tabs - Adding/removing line breaks - Adding trailing commas
This commit is contained in:
parent
b2e5dd2ebb
commit
c689ac1e10
91 changed files with 1710 additions and 689 deletions
|
|
@ -5,6 +5,7 @@ Exceptions:
|
|||
- OrgNotFoundException: Takes an optional org_id int
|
||||
- AwaitingApprovalException: Takes an optional org_id int
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
|
@ -12,15 +13,24 @@ from fastapi import HTTPException, status
|
|||
|
||||
class OrgNotFoundException(HTTPException):
|
||||
def __init__(self, org_id: Optional[int] = None) -> None:
|
||||
detail = "Organisation not found" if org_id is None else f"Organisation with ID '{org_id}' was not found."
|
||||
detail = (
|
||||
"Organisation not found"
|
||||
if org_id is None
|
||||
else f"Organisation with ID '{org_id}' was not found."
|
||||
)
|
||||
super().__init__(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=detail,
|
||||
)
|
||||
|
||||
|
||||
class AwaitingApprovalException(HTTPException):
|
||||
def __init__(self, org_id: Optional[int] = None) -> None:
|
||||
detail = "Organisation has not been approved." if org_id is None else f"Organisation with ID '{org_id}' has not been approved."
|
||||
detail = (
|
||||
"Organisation has not been approved."
|
||||
if org_id is None
|
||||
else f"Organisation with ID '{org_id}' has not been approved."
|
||||
)
|
||||
super().__init__(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail=detail,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue