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

This commit is contained in:
imacat authored and 依瑪貓 committed 2023-02-03 12:57:53 +08:00
1 parent 4aed2f6ba7
commit d368c5e062
1 file changed
+3 -3
+3 -3
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