Skip to content

Commit

Permalink
Merge pull request willhardy#42 from hginer/master
Browse files Browse the repository at this point in the history
Replaces Django Hashcompat with Hashlib
  • Loading branch information
willhardy committed Dec 5, 2013
2 parents 849050b + 1405c78 commit 3089686
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rollyourown/seo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# * Move/rename namespace polluting attributes
# * Documentation
# * Make backends optional: Meta.backends = (path, modelinstance/model, view)
import hashlib

from django.db import models
from django.utils.translation import ugettext_lazy as _
Expand All @@ -14,7 +15,6 @@
from django.conf import settings
from django.utils.safestring import mark_safe
from django.core.cache import cache
from django.utils.hashcompat import md5_constructor
from django.utils.encoding import iri_to_uri

from rollyourown.seo.utils import NotSet, Literal
Expand All @@ -35,9 +35,9 @@ def __init__(self, metadata, instances, path, site=None, language=None):
self.__metadata = metadata
if metadata._meta.use_cache:
if metadata._meta.use_sites and site:
hexpath = md5_constructor(iri_to_uri(site.domain+path)).hexdigest()
hexpath = hashlib.md5(iri_to_uri(site.domain+path)).hexdigest()
else:
hexpath = md5_constructor(iri_to_uri(path)).hexdigest()
hexpath = hashlib.md5(iri_to_uri(path)).hexdigest()
if metadata._meta.use_i18n:
self.__cache_prefix = 'rollyourown.seo.%s.%s.%s' % (self.__metadata.__class__.__name__, hexpath, language)
else:
Expand Down

0 comments on commit 3089686

Please sign in to comment.