#5078 Be consistent in the messages send
Merged 3 years ago by pingou. Opened 3 years ago by pingou.

file modified
+7 -4
@@ -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

pretty please pagure-ci rebuild

3 years ago

1 new commit added

  • Ensure the author info sent always fit the expected schema
3 years ago

2 new commits added

  • Ensure the author info sent always fit the expected schema
  • Be consistent in the messages send
3 years ago

2 new commits added

  • Ensure the author info sent always fit the expected schema
  • Be consistent in the messages send
3 years ago

rebased onto c338454

3 years ago

let's get this in! :)

Pull-Request has been merged by pingou

3 years ago
Metadata