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
1 changed files with 6 additions and 5 deletions

View File

@ -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()