4 char reset token

This commit is contained in:
j 2010-12-24 18:57:36 +05:30
parent d2c760a9a6
commit dfda9a0e6d

View file

@ -250,7 +250,7 @@ def requestToken(request):
user = q[0] user = q[0]
if user: if user:
while True: while True:
token = ox.to32(random.randint(0, 1000000000)) token = ox.to32(random.randint(32768, 1048575))
if models.UserProfile.objects.filter(reset_token=token).count() == 0: if models.UserProfile.objects.filter(reset_token=token).count() == 0:
break break
user_profile = user.get_profile() user_profile = user.get_profile()