Contact image is replaced by gravatar only if no image attached

This commit is contained in:
Nabin Hait 2017-03-30 18:00:15 +05:30
parent 3e0cfbae79
commit df1347d5f1

View file

@ -21,7 +21,7 @@ class Contact(Document):
def validate(self):
self.set_user()
if self.email_id:
if self.email_id and not self.image:
self.image = has_gravatar(self.email_id)
deduplicate_dynamic_links(self)