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:
|
while True:
|
||||||
new_nickname = nickname + str(version)
|
new_nickname = nickname + str(version)
|
||||||
if User.query.filter_by(nickname=new_nickname).first() is None:
|
if User.query.filter_by(nickname=new_nickname).first() is None:
|
||||||
break
|
return new_nickname
|
||||||
version += 1
|
version += 1
|
||||||
return new_nickname
|
|
||||||
|
|
||||||
def is_authenticated(self):
|
def is_authenticated(self):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue