#4147 add avatar_url to output of user/<username> api
Merged 5 months ago by pingou. Opened 5 months ago by ryanlerch.
ryanlerch/pagure issue4050  into  master

file modified
+5 -1

@@ -112,7 +112,8 @@ 

            },

            "user": {

              "fullname": "ralph",

-             "name": "ralph"

+             "name": "ralph",

+             "avatar_url": "https://seccdn.libravatar.org/avatar/5dac3?s=16&d=retro"

            }

          }

  

@@ -172,6 +173,9 @@ 

      )

  

      output["user"] = user.to_json(public=True)

+     output["user"]["avatar_url"] = pagure.lib.query.avatar_url_from_email(

+         user.default_email, size=16

+     )

      output["repos"] = [repo.to_json(public=True) for repo in repos]

      output["forks"] = [repo.to_json(public=True) for repo in forks]

      output["repos_pagination"] = pagination_metadata_repo

@@ -87,8 +87,11 @@ 

                'pages': 0,

                'per_page': 20,

                'prev': None},

-             "user": { "fullname": "PY C", "name": "pingou"}}

+             "user": { "fullname": "PY C",

+                       "name": "pingou",

+                       'avatar_url': 'https://seccdn.libravatar.org/avatar/...'}}

          data = json.loads(output.get_data(as_text=True))

+         data["user"]["avatar_url"] = "https://seccdn.libravatar.org/avatar/..."

          for k in ['forks_pagination', 'repos_pagination']:

              for k2 in ['first', 'last']:

                  self.assertIsNotNone(data[k][k2])

@@ -244,9 +247,11 @@ 

                'prev': None},

              "user": {

                  "fullname": "PY C",

-                 "name": "pingou"

+                 "name": "pingou",

+                 'avatar_url': 'https://seccdn.libravatar.org/avatar/...'

              }

          }

+         data["user"]["avatar_url"] = "https://seccdn.libravatar.org/avatar/..."

          self.assertEqual(data, expected_data)

  

      @patch('pagure.lib.notify.send_email')

Adds the avatar_url value to the output of
the user/username api endpoint

Fixes #4050

rebased onto db783ed5eca2f15948f82b4712d4a721d164e4b0

5 months ago

I'll see if I can make jenkins happy :)

rebased onto 0f457d1e98482d730dcd63738daeb7d6b0ff4825

5 months ago

rebased onto 36ee38f

5 months ago

Pull-Request has been merged by pingou

5 months ago