Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network/node/stats.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2012-11-05 20:29:26 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2012-11-05 20:29:26 (GMT)
commitb76002ae4b2791630782e5bae7f58cbdda2d3207 (patch)
tree03bb520791d25391bfd001754d3172feed3f33b5 /sugar_network/node/stats.py
parente19f168e2497665ece378770b95dd2badde29c3a (diff)
Do not be confused by empty POST props while node stats calculating
Diffstat (limited to 'sugar_network/node/stats.py')
-rw-r--r--sugar_network/node/stats.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sugar_network/node/stats.py b/sugar_network/node/stats.py
index 34ce4e2..68ad22b 100644
--- a/sugar_network/node/stats.py
+++ b/sugar_network/node/stats.py
@@ -351,7 +351,7 @@ class _ReviewStats(_ResourceStats):
context = _ResourceStats.log(self, request)
if request['method'] == 'POST':
- if 'artifact' in request.content:
+ if request.content.get('artifact'):
artifact = self._stats['artifact']
stats = artifact.active_object(request.content['artifact'])
artifact.reviewed += 1
@@ -455,7 +455,7 @@ class _CommentStats(_Stats):
if request['method'] == 'POST':
for owner in ('solution', 'feedback', 'review'):
- if owner in request.content:
+ if request.content.get(owner):
self._stats[owner].commented += 1
break