Renamed the variable in the new_id function from "new" to "obj_id", to be clear.

This commit is contained in:
依瑪貓 2023-02-02 15:46:25 +08:00 committed by 依瑪貓
parent 4aed2f6ba7
commit d368c5e062

View File

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