"Jeff Hinrichs - DM&T" <[EMAIL PROTECTED]> writes:
Working my way through the Identity system, wrt model.py, I see that
the _set_password(self, method in the User class is redefining the
python built-in keyword, hash(1)
def _set_password(self, cleartext_password):
"Runs cleartext_password through the hash algorithm before saving."
hash = identity.encrypt_password(cleartext_password)
self._SO_set_password(hash)
Is it really intended to redefine the built-in? If so, it is not
It probably isn't, but this is just on a 2 line method, where the change is
local and there's no intention of using hash for any other thing there.
clear why it is being done. If that is not the intention, which I
suspect is the case, then this bit of code is more confusing than it
needs to be and I would suggest that it be changed to something that
is less likely to cause confusion/unwanted side-effects.
def _set_password(self, cleartext_password):
"Runs cleartext_password through the hash algorithm before saving."
password_hash = identity.encrypt_password(cleartext_password)
self._SO_set_password(password_hash)
We need a ticket to touch the code on the stable branch. If you can open one
and send a patch I'll apply it on both 1.0 and trunk.
ps. I've also noticed a tendency to use wildcard imports -- I'm not a
big fan of that and once you work on a big enough project with 3rd
party components -- I suspect you won't be either.
There were some fixes on that a while ago, but we (actually I believe it was
gasolin ;-)) haven't proceeded with that.
Patches are also welcome on this area (just be sure that all tests pass...).
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---