From 83866a7736454e3d9ff4b0527d3709e70d00410d Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Tue, 22 Nov 2011 12:51:51 -0500 Subject: [PATCH] Moving from sha module to hashlib. --- utils/ratelimit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/ratelimit.py b/utils/ratelimit.py index 69b6318bf..74d55d3a9 100644 --- a/utils/ratelimit.py +++ b/utils/ratelimit.py @@ -1,7 +1,8 @@ from django.http import HttpResponseForbidden from django.core.cache import cache from datetime import datetime, timedelta -import functools, sha +import functools +import hashlib class ratelimit(object): "Instances of this class can be used as decorators" @@ -101,6 +102,6 @@ class ratelimit_post(ratelimit): # IP address and key_field (if it is set) extra = super(ratelimit_post, self).key_extra(request) if self.key_field: - value = sha.new(request.POST.get(self.key_field, '')).hexdigest() + value = hashlib.sha1(request.POST.get(self.key_field, '')).hexdigest() extra += '-' + value return extra