default to avatar placeholder if avatar has a value but no name
This commit is contained in:
parent
97de26ea85
commit
9befdc9377
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ class UserProfile(models.Model):
|
|||
return "Unknown Profile"
|
||||
|
||||
def avatar_url(self):
|
||||
if self.avatar is None or self.avatar == '':
|
||||
if self.avatar is None or self.avatar.name is None:
|
||||
return settings.STATIC_URL + 'img/avatar_placeholder.png'
|
||||
elif self.avatar.name.startswith('http'):
|
||||
return self.avatar.name
|
||||
|
|
Loading…
Reference in a new issue