Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
rref #5367
Browse files Browse the repository at this point in the history
  • Loading branch information
evrenesat committed Jul 21, 2016
1 parent 74f5633 commit 82620b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ulakbus/models/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
import hashlib

from pyoko import field
from pyoko import Model, ListNode
Expand Down Expand Up @@ -62,6 +63,14 @@ def pre_save(self):
def post_creation(self):
self.prepare_channels()

def get_avatar_url(self):
if self.avatar:
return super(BaseUser, self).get_avatar_url()
else:
# FIXME: This is for fun, remove when we resolve static hosting problem
return "https://www.gravatar.com/avatar/%s" % hashlib.md5(
"%[email protected]" % self.username).hexdigest()



# def send_message(self, title, message, sender=None):
Expand Down

0 comments on commit 82620b9

Please sign in to comment.