Show username if full_name or last_name is empty.

important for create-example_data
This commit is contained in:
Emanuel Schütze 2019-01-20 12:20:17 +01:00
parent 209105efc3
commit 2c5ea299e3
3 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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) {

View File

@ -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 {