From 18fe6e9355805d8275b8690995731582ac8970e4 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Thu, 30 Dec 2021 00:55:37 +0200 Subject: [PATCH] Fixed IBAN generation --- server/foxbank_server/__init__.py | 3 +-- server/foxbank_server/db_utils.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/server/foxbank_server/__init__.py b/server/foxbank_server/__init__.py index 0de7b4a..5b38cd7 100644 --- a/server/foxbank_server/__init__.py +++ b/server/foxbank_server/__init__.py @@ -26,8 +26,7 @@ def create_app(): def init_cors(app): from flask_cors import CORS - cors = CORS() - cors.init_app(app) + cors = CORS(app) def init_db(app): from .db import init_app diff --git a/server/foxbank_server/db_utils.py b/server/foxbank_server/db_utils.py index 338c6d2..3170413 100644 --- a/server/foxbank_server/db_utils.py +++ b/server/foxbank_server/db_utils.py @@ -132,7 +132,7 @@ class Module(ModuleType): from random import randint while True: iban = 'RO00FOXB0' + account.currency - iban += str(randint(0, 10 ** 13)).rjust(12, '0') + iban += str(randint(10, 10 ** 12 - 1)).rjust(12, '0') from .utils.iban import gen_check_digits iban = gen_check_digits(iban) if iban not in ibans: