Add intercom template tags.

master
Nick Sergeant 2013-05-08 17:44:59 -04:00
parent 4006f570c6
commit ab86bef67a
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
from django import template
from settings_local import INTERCOM_SECRET_KEY
import hmac, hashlib
register = template.Library()
@register.filter
def intercom_sha_256(user_id):
return hmac.new(INTERCOM_SECRET_KEY, user_id, digestmod=hashlib.sha256).hexdigest()