Skip to content

sha deprecated from py 2.5 #2

Description

@tredoe

For compatibility with older python version, in django.utils.hashcompat there is a sha_constructor that can be used specifically for this.

So,

value = sha.new(request.POST.get(self.key_field, '')).hexdigest()

could be replaced with:

from django.utils.hashcompat import sha_constructor
value = sha_constructor(request.POST.get(self.key_field, '')).hexdigest()

http://code.djangoproject.com/browser/django/trunk/django/utils/hashcompat.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions