| |
@@ -128,11 +128,15 @@
|
| |
"""Send out-going notifications about the branch/tag."""
|
| |
email = pagure.lib.git.get_author_email(rev, repodir)
|
| |
name = pagure.lib.git.get_author(rev, repodir)
|
| |
- author = pagure.lib.query.search_user(session, email=email)
|
| |
- if author:
|
| |
+ author = pagure.lib.query.search_user(session, email=email) or name
|
| |
+ if not isinstance(author, six.string_types):
|
| |
author = author.to_json(public=True)
|
| |
else:
|
| |
- author = name
|
| |
+ author = {
|
| |
+ "fullname": author,
|
| |
+ "name": None,
|
| |
+ "url_path": None,
|
| |
+ }
|
| |
|
| |
topic = "git.%s.%s" % (subject, action)
|
| |
msg = dict(
|
| |
@@ -180,7 +184,6 @@
|
| |
else:
|
| |
author = {
|
| |
"fullname": author,
|
| |
- "email": None,
|
| |
"name": None,
|
| |
"url_path": None,
|
| |
}
|
| |
The JSON representation of the User object has an 'emails' field
not an 'email' and that field is not present in the public JSON
representation of the User objects (thus not in notifications sent
on the message bus). We can thus drop entirely the 'email' field
that was present until now.
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr