From 9c92a6ecf31f183d655a6749d645b3c2e72d46b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20M=C3=BCnch?= Date: Mon, 17 Jan 2022 01:28:32 +0100 Subject: [PATCH] add backend support for fault_stamp and comment --- coinmanager/coinc/views.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py index abc5db1..d4125e5 100644 --- a/coinmanager/coinc/views.py +++ b/coinmanager/coinc/views.py @@ -298,6 +298,8 @@ def add_coin(request, country, year, value): buy_only = False checked = False ec = False + fault_stamp = False + comment = '' else: @@ -333,9 +335,11 @@ def add_coin(request, country, year, value): elif circulation > 1000000000: return response(1, f"Die Münzauflage '{circulation}' ist unrealistisch.") - buy_only = True if request.POST.get('buy_only') == 'true' else False - checked = True if request.POST.get('checked') == 'true' else False - ec = True if request.POST.get('ec') == 'true' else False + buy_only = True if request.POST.get('buy_only') == 'true' else False + checked = True if request.POST.get('checked') == 'true' else False + ec = True if request.POST.get('ec') == 'true' else False + fault_stamp = True if request.POST.get('fault_stamp') == 'true' else False + comment = request.POST.get('comment', '') try: coin = Coin.objects.get( @@ -352,6 +356,8 @@ def add_coin(request, country, year, value): coin.checked = checked coin.in_collector = ec coin.exists = exists + coin.fault_stamp = fault_stamp + coin.comment = comment coin.save(force_update=True) except Coin.DoesNotExist: @@ -369,7 +375,9 @@ def add_coin(request, country, year, value): buy_only = buy_only, checked = checked, in_collector = ec, - exists = exists) + exists = exists, + fault_stamp = fault_stamp, + comment = comment) return response()