Skip to content
Browse files

patch double signin

  • Loading branch information...
1 parent 91af3cf commit fd276989dc231a45bff367c737a1f9d36d0b9d12 jonathan committed Mar 1, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 main.py
View
6 main.py
@@ -81,6 +81,10 @@ def signin(cls, email, type):
hash = hashlib.md5(email).hexdigest()
image = 'http://0.gravatar.com/avatar/%s' % hash
name = string.capwords(email.split('@')[0].replace('.', ' '))
+ # prevents double signin
+ previous_signin = db.GqlQuery("SELECT * FROM Signin WHERE email = '%s' AND active = true" % email).get()
+ if previous_signin is not None:
+ previous_signin.delete() # delete old signin
s = Signin(email=email, type=type, image_url=image, name=name)
s.put()
return s
@@ -349,4 +353,4 @@ def main():
if __name__ == '__main__':
main()
-
+

0 comments on commit fd27698

Please sign in to comment.
Something went wrong with that request. Please try again.