From 9befdc9377167e5825bf70fa3b3d55e87fa88437 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 18 Mar 2018 12:30:26 -0400 Subject: [PATCH] default to avatar placeholder if avatar has a value but no name --- events/models/profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/models/profiles.py b/events/models/profiles.py index 7127dfb..bb5aee5 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -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