billing: Don't allow guest users to upgrade.

This commit is contained in:
Vishnu KS
2020-07-16 01:48:32 +05:30
committed by Tim Abbott
parent cb01a7f599
commit 67bacd6e31
8 changed files with 84 additions and 38 deletions

View File

@@ -188,6 +188,18 @@ class InvalidJSONError(JsonableError):
def msg_format() -> str:
return _("Malformed JSON")
class OrganizationMemberRequired(JsonableError):
code: ErrorCode = ErrorCode.UNAUTHORIZED_PRINCIPAL
MEMBER_REQUIRED_MESSAGE = _("Must be an organization member")
def __init__(self) -> None:
super().__init__(self.MEMBER_REQUIRED_MESSAGE)
@staticmethod
def msg_format() -> str:
return OrganizationMemberRequired.MEMBER_REQUIRED_MESSAGE
class OrganizationAdministratorRequired(JsonableError):
code: ErrorCode = ErrorCode.UNAUTHORIZED_PRINCIPAL