diff --git a/counter/views.py b/counter/views.py index 8f2553b..630e5cd 100644 --- a/counter/views.py +++ b/counter/views.py @@ -201,7 +201,7 @@ def arrow_count_fetch_ajax(request, ac_id): else: return JsonResponse({ 'success': True, - 'count': count[1] + 'count': count[1].count }) def get_arrowcount(ac_id, request): @@ -232,10 +232,11 @@ def arrow_count_update_ajax(request, ac_id): 'error': _('count is negative or 0') }) - count = get_arrowcount(ac_id, request) - if not count[0]: - return count[1] - arrow_count.count = count[1] + tup = get_arrowcount(ac_id, request) + if not tup[0]: + return tup[1] + arrow_count = tup[1] + arrow_count.count = count try: arrow_count.save()