feat: add polls
This commit is contained in:
@@ -49,11 +49,11 @@ class UserBanned(Exception):
|
||||
return 'User banned'
|
||||
|
||||
class ValidationError(Exception):
|
||||
def __init__(self, name: str, value: str):
|
||||
self.name = name
|
||||
self.value = value
|
||||
# def __init__(self, name: str, value: str):
|
||||
# self.name = name
|
||||
# self.value = value
|
||||
def __str__(self):
|
||||
return f'Failed validation on {self.name}: "{self.value}"'
|
||||
return 'Failed validation'# on {self.name}: "{self.value}"'
|
||||
|
||||
class PendingRequestExists(Exception):
|
||||
def __str__(self):
|
||||
@@ -117,4 +117,16 @@ class AlreadyFollowing(Exception):
|
||||
|
||||
class AccountBanned(Exception):
|
||||
def __str__(self) -> str:
|
||||
return 'Account has been deactivated'
|
||||
return 'Account has been deactivated'
|
||||
|
||||
class OptionsNotBelong(Exception):
|
||||
def __str__(self) -> str:
|
||||
return 'One or more options do not belong to poll'
|
||||
|
||||
class NotMultipleChoice(Exception):
|
||||
def __str__(self) -> str:
|
||||
return 'Only one option can be choosen in this poll'
|
||||
|
||||
class EmptyOptions(Exception):
|
||||
def __str__(self) -> str:
|
||||
return 'Options cannot be empty (pre-validation)'
|
||||
Reference in New Issue
Block a user