Skip to content

Commit

Permalink
Fixing anonymous user image is not showing up (#761)
Browse files Browse the repository at this point in the history
* Fixing anonymous user image is not showing up

* adding dummy user image
  • Loading branch information
spiderxm authored Jun 1, 2021
1 parent efedfec commit 774eb44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Binary file added website/static/images/dummy-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions website/templates/_activity.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{% load gravatar %}
{% load static %}
<div class="list-group-item activity-strip">
<div class="activity-strip-section">
{% if activity.user.userprofile.avatar %}
<img src="{{ activity.user.userprofile.avatar }}" width="100" class="img-responsive img-rounded">
{% elif activity.user.socialaccount_set.all.0.get_avatar_url %}
<img src="{{ activity.user.socialaccount_set.all.0.get_avatar_url }}" width="100" class="img-responsive img-rounded">
{% else %}
<img src="{{ activity.user.socialaccount_set.all.0.get_avatar_url }}" width="100"
class="img-responsive img-rounded">
{% elif activity.user.email %}
<img src="{% gravatar_url activity.user.email 100 %}" width="100" class="img-responsive img-rounded">
{% else %}
<img src="{% static 'images/dummy-user.png' %}" width="100"
class="img-responsive img-rounded">
{% endif %}

<div class="info">
Expand Down

0 comments on commit 774eb44

Please sign in to comment.