mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Fix zerver.lib.utils.generate_random_token.
generate_random_token used to return a value of type six.binary_type and its return type was annotated as `str`. This commit fixes that by making it return a value of type `six.text_type` and updating the annotation accordingly. Also fix clashing annnotations.
This commit is contained in:
committed by
Tim Abbott
parent
56d5785c2e
commit
10f2ec043d
@@ -110,5 +110,5 @@ def log_statsd_event(name):
|
||||
statsd.incr(event_name)
|
||||
|
||||
def generate_random_token(length):
|
||||
# type: (int) -> str
|
||||
return base64.b16encode(os.urandom(length // 2)).lower()
|
||||
# type: (int) -> text_type
|
||||
return base64.b16encode(os.urandom(length // 2)).decode('utf-8').lower()
|
||||
|
||||
Reference in New Issue
Block a user