Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor fix for concurrent checkin update

  • Loading branch information...
commit 7929a4919cb1d4dde910a413602ebb90da545de0 1 parent a366382
@rosolovskiy rosolovskiy authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 index.py
View
4 index.py
@@ -136,8 +136,8 @@ def api_checkin(sitehash):
checkin = get_default_checkin(sitehash)
mongo.db.kitty.insert(checkin)
else:
- checkin['checkins'] = int(checkin['checkins']) + 1
- mongo.db.kitty.update({'sitehash': sitehash}, checkin)
+ checkin_inc = {"$inc": {"checkins": 1}}
+ mongo.db.kitty.update({'sitehash': sitehash}, checkin_inc)
checkin['error'] = 0
checkin["comments_url"] = '/api/v1/comments/' + sitehash
if checkin.has_key("comments"):
Please sign in to comment.
Something went wrong with that request. Please try again.