# HG changeset patch # User Thomas De Schampheleire # Date 2015-06-23 20:23:13 # Node ID 18fc1888455f43a9b1a4f289c1769285ca946d68 # Parent df3079729bd908769fee149b678566284913000f user: rename property username_and_name into full_name_and_username In analogy of existing properties full_name and full_name_or_username, rename username_and_name into full_name_and_username. diff --git a/kallithea/model/comment.py b/kallithea/model/comment.py --- a/kallithea/model/comment.py +++ b/kallithea/model/comment.py @@ -100,7 +100,7 @@ class ChangesetCommentsModel(BaseModel): recipients += [cs_author] email_kwargs = { 'status_change': status_change, - 'cs_comment_user': h.person(user, 'username_and_name'), + 'cs_comment_user': h.person(user, 'full_name_and_username'), 'cs_target_repo': h.canonical_url('summary_home', repo_name=repo.repo_name), 'cs_comment_url': comment_url, 'raw_id': revision, @@ -148,7 +148,7 @@ class ChangesetCommentsModel(BaseModel): 'status_change': status_change, 'closing_pr': closing_pr, 'pr_comment_url': comment_url, - 'pr_comment_user': h.person(user, 'username_and_name'), + 'pr_comment_user': h.person(user, 'full_name_and_username'), 'pr_target_repo': h.canonical_url('summary_home', repo_name=pull_request.other_repo.repo_name), 'repo_name': pull_request.other_repo.repo_name, diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -472,10 +472,6 @@ class User(Base, BaseModel): return [x.ip_addr for x in ret] @property - def username_and_name(self): - return '%s (%s %s)' % (self.username, self.firstname, self.lastname) - - @property def full_name(self): return '%s %s' % (self.firstname, self.lastname) @@ -485,6 +481,10 @@ class User(Base, BaseModel): if (self.firstname and self.lastname) else self.username) @property + def full_name_and_username(self): + return '%s (%s %s)' % (self.username, self.firstname, self.lastname) + + @property def full_contact(self): return '%s %s <%s>' % (self.firstname, self.lastname, self.email) diff --git a/kallithea/templates/changeset/changeset.html b/kallithea/templates/changeset/changeset.html --- a/kallithea/templates/changeset/changeset.html +++ b/kallithea/templates/changeset/changeset.html @@ -114,7 +114,7 @@ ${self.repo_context_bar('changelog', c.c
${h.gravatar(h.email_or_none(c.changeset.author), size=20)}
- ${h.person(c.changeset.author,'username_and_name')} - ${h.age(c.changeset.date,True)} ${h.fmt_date(c.changeset.date)}
+ ${h.person(c.changeset.author,'full_name_and_username')} - ${h.age(c.changeset.date,True)} ${h.fmt_date(c.changeset.date)}
${h.email_or_none(c.changeset.author)}
<% rev = c.changeset.extra.get('source') %> diff --git a/kallithea/templates/changeset/changeset_file_comment.html b/kallithea/templates/changeset/changeset_file_comment.html --- a/kallithea/templates/changeset/changeset_file_comment.html +++ b/kallithea/templates/changeset/changeset_file_comment.html @@ -12,7 +12,7 @@ ${h.gravatar(co.author.email, size=20)}
- ${co.author.username_and_name} + ${co.author.full_name_and_username}
diff --git a/kallithea/templates/pullrequests/pullrequest_data.html b/kallithea/templates/pullrequests/pullrequest_data.html --- a/kallithea/templates/pullrequests/pullrequest_data.html +++ b/kallithea/templates/pullrequests/pullrequest_data.html @@ -58,7 +58,7 @@ - ${pr.author.username_and_name} + ${pr.author.full_name_and_username} diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html +++ b/kallithea/templates/pullrequests/pullrequest_show.html @@ -158,7 +158,7 @@ ${self.repo_context_bar('showpullrequest
${h.gravatar(c.pull_request.author.email, size=20)}
- ${c.pull_request.author.username_and_name}
+ ${c.pull_request.author.full_name_and_username}
${c.pull_request.author.email}