Changeset - 5ebd887522ea
[Not reviewed]
default
0 3 0
Andrew Shadura - 12 years ago 2014-01-12 17:30:00
andrew@shadura.me
helpers: user email can be unset

Check for not being empty, not for ''.
Also, don't call person() with email, as it can't be caught properly.
3 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -478,7 +478,7 @@ def is_hg(repository):
 
def email_or_none(author):
 
    # extract email from the commit string
 
    _email = email(author)
 
    if _email != '':
 
    if _email:
 
        # check it against Kallithea database, and use the MAIN email for this
 
        # user
 
        user = User.get_by_email(_email, case_insensitive=True, cache=True)
 
@@ -506,7 +506,7 @@ def person(author, show_attr="username")
 

	
 
    # Valid email in the attribute passed, see if they're in the system
 
    _email = email(author)
 
    if _email != '':
 
    if _email:
 
        user = User.get_by_email(_email, case_insensitive=True, cache=True)
 
        if user is not None:
 
            return person_getter(user)
kallithea/model/comment.py
Show inline comments
 
@@ -105,7 +105,7 @@ class ChangesetCommentsModel(BaseModel):
 
            recipients += [cs_author]
 
            email_kwargs = {
 
                'status_change': status_change,
 
                'cs_comment_user': h.person(user.email),
 
                'cs_comment_user': h.person(user),
 
                'cs_target_repo': h.url('summary_home', repo_name=repo.repo_name,
 
                                        qualified=True),
 
                'cs_comment_url': _url,
 
@@ -147,7 +147,7 @@ class ChangesetCommentsModel(BaseModel):
 
                'status_change': status_change,
 
                'closing_pr': closing_pr,
 
                'pr_comment_url': _url,
 
                'pr_comment_user': h.person(user.email),
 
                'pr_comment_user': h.person(user),
 
                'pr_target_repo': h.url('summary_home',
 
                                   repo_name=pull_request.other_repo.repo_name,
 
                                   qualified=True)
kallithea/model/pull_request.py
Show inline comments
 
@@ -134,7 +134,7 @@ class PullRequestModel(BaseModel):
 
        body = pr.description
 
        kwargs = {
 
            'pr_title': pr.title,
 
            'pr_user_created': h.person(pr.author.email),
 
            'pr_user_created': h.person(pr.author),
 
            'pr_repo_url': h.url('summary_home', repo_name=pr.other_repo.repo_name,
 
                                 qualified=True,),
 
            'pr_url': pr_url,
0 comments (0 inline, 0 general)