1. Peter Sanchez
  2. djpubsubhubbub


arski  committed ce6db2d

Replacing deprecated Django hashcompat library with Pythons native hashlib

  • Participants
  • Parent commits 1fd6caf
  • Branches default

Comments (0)

Files changed (1)

File djpubsubhubbub/models.py

View file
 import feedparser
 from urllib import urlencode
 from datetime import datetime, timedelta
+from hashlib import sha1
 from django.db import models
 from django.conf import settings
-from django.utils.hashcompat import sha_constructor
 from django.core.urlresolvers import reverse, NoReverseMatch
 from djpubsubhubbub import signals
     def generate_token(self, mode, run_save=True):
         assert self.pk is not None, \
             'Subscription must be saved before generating token'
-        token = mode[:20] + sha_constructor('%s%i%s' % (
+        token = mode[:20] + sha1('%s%i%s' % (
                 settings.SECRET_KEY, self.pk, mode)).hexdigest()
         self.verify_token = token
         if run_save: