server: Retrieve first avatar from result set.

This commit is contained in:
Stuart Longland 2018-01-06 18:53:51 +10:00
parent 43904297d6
commit f23da7844e
Signed by: stuartl
GPG Key ID: 6AA32EFB18079BAA

View File

@ -40,7 +40,7 @@ class CallbackHandler(RequestHandler):
if user is None: if user is None:
# New user, do we have their avatar on file? # New user, do we have their avatar on file?
avatar = self.application._db.query(Avatar).filter( avatar = self.application._db.query(Avatar).filter(
Avatar.url==user_data['image_url']) Avatar.url==user_data['image_url']).first()
if avatar is None: if avatar is None:
# We don't have the avatar yet # We don't have the avatar yet
avatar_res = yield self._client.fetch(user_data['image_url']) avatar_res = yield self._client.fetch(user_data['image_url'])