Merge pull request #4158 from emanuelschuetze/username

Show username if full_name or last_name is empty.
This commit is contained in:
Emanuel Schütze 2019-01-21 22:48:22 +01:00 committed by GitHub
commit 07f65601e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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}`; shortName = `${title} ${shortName}`;
} }
return shortName; return shortName || this.username;
} }
public getTitle(): string { public getTitle(): string {
return this.full_name; return this.full_name || this.username;
} }
public getListViewTitle(): string { public getListViewTitle(): string {

View File

@ -43,7 +43,7 @@ export class ViewSpeaker extends BaseViewModel implements Selectable {
} }
public get name(): string { public get name(): string {
return this.user.full_name; return this.user.full_name || this.user.username;
} }
public constructor(speaker?: Speaker, user?: User) { public constructor(speaker?: Speaker, user?: User) {

View File

@ -36,11 +36,11 @@ export class ViewUser extends BaseProjectableModel {
} }
public get full_name(): string { 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 { 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 { public get email(): string {