##// END OF EJS Templates
ux: adjust email_or_none so that it does not swap emails
lisaq -
r409:1a0e6c35 default
parent child Browse files
Show More
@@ -772,19 +772,17 b' def discover_user(author):'
772 772 def email_or_none(author):
773 773 # extract email from the commit string
774 774 _email = author_email(author)
775
776 # If we have an email, use it, otherwise
777 # see if it contains a username we can get an email from
775 778 if _email != '':
776 # check it against RhodeCode database, and use the MAIN email for this
777 # user
778 user = User.get_by_email(_email, case_insensitive=True, cache=True)
779 if user is not None:
780 return user.email
781 779 return _email
782
783 # See if it contains a username we can get an email from
784 user = User.get_by_username(author_name(author), case_insensitive=True,
780 else:
781 user = User.get_by_username(author_name(author), case_insensitive=True,
785 782 cache=True)
783
786 784 if user is not None:
787 return user.email
785 return user.email
788 786
789 787 # No valid email, not a valid user in the system, none!
790 788 return None
General Comments 0
You need to be logged in to leave comments. Login now