Refactor member actions into members.py

This commit is contained in:
Ske 2018-09-16 13:46:22 +02:00
parent 05cf04df03
commit cae394b4e8
7 changed files with 214 additions and 109 deletions

View file

@ -55,3 +55,15 @@ class AccountAlreadyLinkedError(PluralKitError):
class UnlinkingLastAccountError(PluralKitError):
def __init__(self):
super().__init__("This is the only account on your system, so you can't unlink it.")
class MemberNameTooLongError(PluralKitError):
def __init__(self, tag_present: bool):
if tag_present:
super().__init__("The maximum length of a name plus the system tag is 32 characters. Please reduce the length of the tag, or choose a shorter member name.")
else:
super().__init__("The maximum length of a member name is 32 characters.")
class InvalidColorError(PluralKitError):
def __init__(self):
super().__init__("Color must be a valid hex color. (eg. #ff0000)")