Fixed update bug on arrowcount edit

This commit is contained in:
Claudio Maggioni (maggicl) 2019-08-01 13:52:52 +02:00
parent f2f8b57e0a
commit f69c1e6318

View file

@ -201,7 +201,7 @@ def arrow_count_fetch_ajax(request, ac_id):
else: else:
return JsonResponse({ return JsonResponse({
'success': True, 'success': True,
'count': count[1] 'count': count[1].count
}) })
def get_arrowcount(ac_id, request): def get_arrowcount(ac_id, request):
@ -232,10 +232,11 @@ def arrow_count_update_ajax(request, ac_id):
'error': _('count is negative or 0') 'error': _('count is negative or 0')
}) })
count = get_arrowcount(ac_id, request) tup = get_arrowcount(ac_id, request)
if not count[0]: if not tup[0]:
return count[1] return tup[1]
arrow_count.count = count[1] arrow_count = tup[1]
arrow_count.count = count
try: try:
arrow_count.save() arrow_count.save()