add backend support for fault_stamp and comment

This commit is contained in:
Moritz Münch 2022-01-17 01:28:32 +01:00
parent da4c580c18
commit 9c92a6ecf3

View File

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