Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

patch double signin #3

Merged
4 commits merged into from

1 participant

@mdks

this one should really work. it saves the Signin object and doesnt delete them. it uses the deactivate staffer method so it should save the time delta for the appreciation email. just a minor patch. :)

thanks,
jon

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2011
  1. patch double signin

    jonathan authored
  2. undo last thing i did

    jonathan authored
  3. a better patch for double sign in

    jonathan authored
  4. oops sorry old cold

    jonathan authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 main.py
View
8 main.py
@@ -50,7 +50,7 @@ def get_active_staff(cls):
for staffer in staffers.fetch(1000):
td = datetime.now()-staffer.created
if td.seconds > MAX_SIGNIN_TIME:
- staffer.active = False;
+ staffer.active = False
staffer.closed = datetime.now()
staffer.time_delta = MAX_SIGNIN_TIME
staffer.put()
@@ -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:
+ cls.deactivate_staffer(email)
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()
-
+
Something went wrong with that request. Please try again.