Permalink
Browse files

[*] Return full user stats in status ('sets_found', 'failures', 'score')

  • Loading branch information...
1 parent 8ab23e5 commit 1704e8e59e5328acb19197cc327b406a9692a3b2 Serge Travin committed Jul 31, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −0 setwithme/apps/game/models.py
  2. +1 −1 setwithme/apps/game/views.py
@@ -164,6 +164,7 @@ def serialize(self, current_user_id):
'me': self.user.id == current_user_id,
'sets_found': self.sets_found,
'failures': self.failures,
+ 'score': self.sets_found - self.failures,
'user_name': self.name}
def update(self):
@@ -95,7 +95,7 @@ def check_set(request, game_id):
cards = [Card(id=card_id) for card_id in ids_lst]
if not is_set(*cards):
gs.state = GameSessionState.SET_PENALTY
- gs.sets_found -= 1
+ gs.failures += 1
gs.save()
result = {'success': False, 'msg': 'Not SET!'}
else:

0 comments on commit 1704e8e

Please sign in to comment.