From 8dba78c474805d1f6de4f490e42ca30979a0c371 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Tue, 14 Mar 2023 12:12:05 +0100
Subject: [PATCH] Return default user avatar if not set
---
app/users/routes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/users/routes.py b/app/users/routes.py
index cd3f2ba4..64dca884 100644
--- a/app/users/routes.py
+++ b/app/users/routes.py
@@ -65,7 +65,7 @@ def user(user_id):
def profile_avatar(user_id):
user = User.query.get_or_404(user_id)
if user.avatar is None:
- abort(404)
+ return redirect(url_for('static', filename='images/default_avatar.png'))
if not user.is_public and not (user == current_user or current_user.is_administrator()):
abort(403)
return send_from_directory(