1. Luke Plant
  2. django

Commits

mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed c6e05a1

Added an import that was missed in [8193]. Thanks Karen Tracey. Fixed #8143.

  • Participants
  • Parent commits 2773a80
  • Branches default

Comments (0)

Files changed (1)

File tests/regressiontests/file_uploads/views.py

View file
  • Ignore whitespace
 import os
-import sha
 from django.core.files.uploadedfile import UploadedFile
 from django.http import HttpResponse, HttpResponseServerError
 from django.utils import simplejson
 from uploadhandler import QuotaUploadHandler
+from django.utils.hashcompat import sha_constructor
 
 def file_upload_view(request):
     """
             continue
         submitted_hash = form_data[key + '_hash']
         if isinstance(value, UploadedFile):
-            new_hash = sha.new(value.read()).hexdigest()
+            new_hash = sha_constructor(value.read()).hexdigest()
         else:
-            new_hash = sha.new(value).hexdigest()
+            new_hash = sha_constructor(value).hexdigest()
         if new_hash != submitted_hash:
             return HttpResponseServerError()