Fix auth key bug introduced in last change

This commit is contained in:
Ian Gulliver
2014-05-28 14:58:37 -07:00
parent a70982243b
commit 0ad033550c

View File

@@ -37,10 +37,10 @@ def GetAuthKey():
if _AUTH_KEY:
return _AUTH_KEY[0]
for key in AuthKey.all().filter('live =', True):
auth_key = key.auth_key
if not auth_key:
auth_keys = AuthKey.all().filter('live =', True).fetch(1)
if auth_keys:
auth_key = auth_keys[0].auth_key
else:
auth_key = ''.join(random.choice(_KEY_CHARS) for _ in xrange(_KEY_LENGTH))
AuthKey(auth_key=auth_key).put()