Update models.py
Wonder if it is better to return a local variable inside a while-loop?
This commit is contained in:
parent
5e9cc831e8
commit
d84000d381
|
@ -46,9 +46,8 @@ class User(db.Model):
|
|||
while True:
|
||||
new_nickname = nickname + str(version)
|
||||
if User.query.filter_by(nickname=new_nickname).first() is None:
|
||||
break
|
||||
version += 1
|
||||
return new_nickname
|
||||
version += 1
|
||||
|
||||
def is_authenticated(self):
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue