New secrets system and quotas (#35)
This commit is contained in:
@@ -286,3 +286,23 @@ class UserCredentialsInvalid(HTTPException):
|
||||
status_code=401,
|
||||
detail=self.openapi["content"]["application/json"]["example"]["detail"],
|
||||
)
|
||||
|
||||
|
||||
class UserMediaQuotaReached(HTTPException):
|
||||
"""Raises HTTP 403 if user's quota has been reached."""
|
||||
|
||||
def __init__(self):
|
||||
self.openapi = {
|
||||
"description": "Media Quota Reached",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"example": {
|
||||
"detail": "Media quota has been reached, media upload impossible."
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
super().__init__(
|
||||
status_code=403,
|
||||
detail=self.openapi["content"]["application/json"]["example"]["detail"],
|
||||
)
|
||||
|
Reference in New Issue
Block a user