mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
confirmation: Create ConfirmationKeyException class.
This commit is contained in:
@@ -24,6 +24,16 @@ from six.moves import range
|
|||||||
import string
|
import string
|
||||||
from typing import Any, Dict, Optional, Text, Union
|
from typing import Any, Dict, Optional, Text, Union
|
||||||
|
|
||||||
|
class ConfirmationKeyException(Exception):
|
||||||
|
WRONG_LENGTH = 1
|
||||||
|
EXPIRED = 2
|
||||||
|
DOES_NOT_EXIST = 3
|
||||||
|
|
||||||
|
def __init__(self, error_type):
|
||||||
|
# type: (int) -> None
|
||||||
|
super(Exception, self).__init__()
|
||||||
|
self.error_type = error_type
|
||||||
|
|
||||||
def generate_key():
|
def generate_key():
|
||||||
# type: () -> str
|
# type: () -> str
|
||||||
generator = SystemRandom()
|
generator = SystemRandom()
|
||||||
|
|||||||
Reference in New Issue
Block a user