Skip to content

Commit

Permalink
better import in model.user
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 10, 2012
1 parent cca7b08 commit e97546a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ckan/model/user.py
@@ -1,7 +1,7 @@
import datetime
import re
import os
from hashlib import sha1
from hashlib import sha1, md5

from sqlalchemy.sql.expression import or_
from sqlalchemy.orm import synonym
Expand Down Expand Up @@ -54,11 +54,10 @@ def display_name(self):

@property
def email_hash(self):
import hashlib
e = ''
if self.email:
e = self.email.strip().lower().encode('utf8')
return hashlib.md5(e).hexdigest()
return md5(e).hexdigest()

def get_reference_preferred_for_uri(self):
'''Returns a reference (e.g. name, id, openid) for this user
Expand Down

0 comments on commit e97546a

Please sign in to comment.