Closed GoogleCodeExporter closed 9 years ago
Do you have a testcase to reproduce this? Because as of 0.1.3 the hashkey is
unique, so
even if the two users have the same challenge, they will get a different DB
object and
tow distinct delete() calls.
Or am I missing something here?
Original comment by mbonetti
on 23 Jan 2010 at 12:35
I ran the following code in python 2.5
>>> import hashlib
>>> str='abc'
>>> hashlib.new('sha', str).hexdigest()
'0164b8a914cd2a5e74c4f7ff082c4d97f1edf880'
>>> hashlib.new('sha', str).hexdigest()
'0164b8a914cd2a5e74c4f7ff082c4d97f1edf880'
the hash value is always the same.
so i suppose, in CaptchaStore(models.Model), self.hashkey = hashlib.new('sha',
str(self.challenge) + str(self.response)).hexdigest() will produce same hashkey
if 2
different user will get the same challenge.
Is my understanding right?
Original comment by zhanglia...@gmail.com
on 23 Jan 2010 at 12:49
True, but as of v0.1.3 we introduce a random element when we compute the hash,
see:
/trunk/captcha/models.py#22
There is another bug, though. Fixing and writing a testcase right now...
Original comment by mbonetti
on 23 Jan 2010 at 1:04
oh man!
there it is in /trunk/captcha/models.py
but not in django-simple-captcha-0.1.3.zip!
pls close the defect and thank you for you instant response!
sorry for the inconvenience.
Original comment by zhanglia...@gmail.com
on 23 Jan 2010 at 1:13
Uh? I just checked and it is in django-simple-captcha-0.1.3.zip
Anyway, the field constructor was reusing old CaptchaStore objects
(get_or_create()
instead of a plain create()) which makes your remark actually true :)
This is fixed as of 0.1.4, cheers.
Original comment by mbonetti
on 23 Jan 2010 at 1:18
Original issue reported on code.google.com by
zhanglia...@gmail.com
on 23 Jan 2010 at 12:12