error correction
authorLaure Bourgois <Laure.Bourgois@logilab.fr>
Fri, 06 Feb 2009 12:03:58 +0100
changeset 558 a8887dd924f4
parent 557 8bb60606e5ad
child 559 7cfd3d11edc8
error correction
web/views/euser.py
--- a/web/views/euser.py	Fri Feb 06 11:05:41 2009 +0100
+++ b/web/views/euser.py	Fri Feb 06 12:03:58 2009 +0100
@@ -14,14 +14,11 @@
 from cubicweb.web.form import EntityForm
 from cubicweb.web.views.baseviews import PrimaryView, EntityView
 
-import hashlib
+try:
+    from hashlib import sha1 as sha 
 
-try:
-    from hashlib import sha1
-    
 except ImportError:
-    from sha import sha as sha1
-
+    from sha import sha
 
 class EUserPrimaryView(PrimaryView):
     accepts = ('EUser',)
@@ -75,7 +72,7 @@
                    % html_escape(entity.firstname))
         emailaddr = entity.get_email()
         if emailaddr:
-            m = hashlib.sha1()
+            m = sha()
             m.update(html_escape(emailaddr))
             crypt_sha1 = m.hexdigest()
             self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n' % crypt_sha1)