chore: don't tell users to contact admin for wrong password or wrong username
@@ -43,10 +43,11 @@ class NotFoundException(APIException):
class ForbiddenException(BadRequestException):
def __init__(self, username: str, message: str = ""):
- super().__init__(
- message=f"Forbidden({message}): Please contact your administrator "
- "in order to access this resource."
- )
+ err_message = f"Forbidden({message})"
+ if not (message == "invalid credentials" or message == "user not found"):
+ err_message += ": Please contact your administrator in order to access this resource."
+
+ super().__init__(message=err_message)
self.username = username
