Skip to content

Commit

Permalink
fix: #601 Fix copy inconsistency (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz authored Jul 30, 2024
1 parent daa164f commit d34eab4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/backend/apps/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ class UserProfile(models.Model):
)

def __str__(self) -> str:
return f"{self.first_name} {self.last_name}"
full_name = f"{self.first_name} {self.last_name}".strip()
return full_name if full_name else self.user.email
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const TenantInvitationForm = ({ initialData, onSubmit, error, loading }:
id: 'Tenant invitation form / Email label',
})}
placeholder={intl.formatMessage({
defaultMessage: 'Name',
defaultMessage: 'Email',
id: 'Tenant invitation form / Email placeholder',
})}
error={errors.email?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const TenantMembers = () => {
</Paragraph>
<Button data-testid="tenant-members-create-button" color="primary" size="sm" onClick={handleNewTenantClick}>
<Plus className="mr-1" size="16" />{' '}
<FormattedMessage defaultMessage="Create new tenant" id="TenantSwitch / Create new organization" />
<FormattedMessage defaultMessage="Create new organization" id="TenantSwitch / Create new organization" />
</Button>
</Alert>
) : (
Expand Down
7 changes: 7 additions & 0 deletions packages/workers/userauth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class User(models.Base):
cruddemoitem_set: Mapped[List["CrudDemoItem"]] = relationship(back_populates="created_by")
documents: Mapped[List["DocumentDemoItem"]] = relationship(back_populates="created_by")

def __str__(self):
return self.email


class UserProfile(models.Base):
__tablename__ = "users_userprofile"
Expand All @@ -34,3 +37,7 @@ class UserProfile(models.Base):

first_name = Column("first_name", String)
last_name = Column("last_name", String)

def __str__(self):
full_name = f"{self.first_name} {self.last_name}".strip()
return full_name if full_name else self.user.email

0 comments on commit d34eab4

Please sign in to comment.