handle name can be None in get_name_initial()
This commit is contained in:
parent
f4218a0693
commit
4bfe6d1ac9
|
@ -524,6 +524,8 @@ class User(db.Model, ModelMixin, UserMixin):
|
||||||
return self.name, [other_name, "Anonymous", "whoami"]
|
return self.name, [other_name, "Anonymous", "whoami"]
|
||||||
|
|
||||||
def get_name_initial(self) -> str:
|
def get_name_initial(self) -> str:
|
||||||
|
if not self.name:
|
||||||
|
return ""
|
||||||
names = self.name.split(" ")
|
names = self.name.split(" ")
|
||||||
return "".join([n[0].upper() for n in names if n])
|
return "".join([n[0].upper() for n in names if n])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue