From 8d5ba29bf8de065348f0f98453fffe2b54620099 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Tue, 19 May 2020 15:06:37 +0200 Subject: [PATCH] #30: allow integer formats like 1.500.000 for #circulation --- coinmanager/coinc/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py index 9e354ff..22e0185 100644 --- a/coinmanager/coinc/views.py +++ b/coinmanager/coinc/views.py @@ -135,8 +135,7 @@ def show_coin(country, year, stamp, value): @param stamp: stamp_id @param value: int e [1,2,5,10,20,50,100,200,201,202,203] ''' -# TODO fix this before the end of 2098 - year = int(year) + year = int(year) # TODO fix this before the end of 2098 if year == 99: year += 1900 else: @@ -309,7 +308,7 @@ def add_coin(request): circulation = request.POST['circulation'] if request.POST['circulation'] else 0 try: - circulation = int(circulation) + circulation = int(circulation.replace('.', '')) except ValueError: return response(1, f"Die Münzauflage '{circulation}' muss eine Zahl sein.") if circulation < 0: