Show username if full_name or last_name is empty.
important for create-example_data
This commit is contained in:
parent
209105efc3
commit
2c5ea299e3
@ -87,11 +87,11 @@ export class User extends BaseModel<User> implements Searchable {
|
||||
shortName = `${title} ${shortName}`;
|
||||
}
|
||||
|
||||
return shortName;
|
||||
return shortName || this.username;
|
||||
}
|
||||
|
||||
public getTitle(): string {
|
||||
return this.full_name;
|
||||
return this.full_name || this.username;
|
||||
}
|
||||
|
||||
public getListViewTitle(): string {
|
||||
|
@ -43,7 +43,7 @@ export class ViewSpeaker extends BaseViewModel implements Selectable {
|
||||
}
|
||||
|
||||
public get name(): string {
|
||||
return this.user.full_name;
|
||||
return this.user.full_name || this.user.username;
|
||||
}
|
||||
|
||||
public constructor(speaker?: Speaker, user?: User) {
|
||||
|
@ -36,11 +36,11 @@ export class ViewUser extends BaseProjectableModel {
|
||||
}
|
||||
|
||||
public get full_name(): string {
|
||||
return this.user ? this.user.full_name : null;
|
||||
return this.user ? this.user.full_name || this.username : null;
|
||||
}
|
||||
|
||||
public get short_name(): string {
|
||||
return this.user ? this.user.short_name : null;
|
||||
return this.user ? this.user.short_name || this.username : null;
|
||||
}
|
||||
|
||||
public get email(): string {
|
||||
|
Loading…
Reference in New Issue
Block a user