From 326dd0284afd231c8c536b523bc26808a75eca1b Mon Sep 17 00:00:00 2001 From: zuber Date: Fri, 2 Oct 2009 23:41:40 +0200 Subject: [PATCH 1/1] Use string.ascii_letters instead of string.letters in utils._generate_string to prevent the server from blowing up when locale is other than C. --- cas_provider/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cas_provider/utils.py b/cas_provider/utils.py index 3d64c16..04a5c12 100644 --- a/cas_provider/utils.py +++ b/cas_provider/utils.py @@ -3,9 +3,9 @@ import string from models import ServiceTicket, LoginTicket -def _generate_string(length=8, chars=string.letters + string.digits): +def _generate_string(length=8, chars=string.ascii_letters + string.digits): """ Generates a random string of the requested length. Used for creation of tickets. """ - return ''.join(Random().sample(string.letters+string.digits, length)) + return ''.join(Random().sample(chars, length)) def create_service_ticket(user, service): """ Creates a new service ticket for the specified user and service. -- 2.20.1