This repository has been archived by the owner on Jun 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rref #5366 ref zetaops/zengine#66 ref zetaops/zengine#65
- Loading branch information
Showing
1 changed file
with
9 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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): | ||
|