From d368c5e0625a40602e021477dffb751bb3e99b95 Mon Sep 17 00:00:00 2001 From: imacat Date: Thu, 2 Feb 2023 15:46:25 +0800 Subject: [PATCH] Renamed the variable in the new_id function from "new" to "obj_id", to be clear. --- src/accounting/utils/random_id.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/accounting/utils/random_id.py b/src/accounting/utils/random_id.py index 54afa05..9c4ecc0 100644 --- a/src/accounting/utils/random_id.py +++ b/src/accounting/utils/random_id.py @@ -32,6 +32,6 @@ def new_id(cls: t.Type): :return: The generated new random ID. """ while True: - new: int = 100000000 + randbelow(900000000) - if db.session.get(cls, new) is None: - return new + obj_id: int = 100000000 + randbelow(900000000) + if db.session.get(cls, obj_id) is None: + return obj_id