Return default user avatar if not set

This commit is contained in:
Patrick Jentsch 2023-03-14 12:12:05 +01:00
parent 8aebe27aa8
commit 8dba78c474

View File

@ -65,7 +65,7 @@ def user(user_id):
def profile_avatar(user_id): def profile_avatar(user_id):
user = User.query.get_or_404(user_id) user = User.query.get_or_404(user_id)
if user.avatar is None: 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()): if not user.is_public and not (user == current_user or current_user.is_administrator()):
abort(403) abort(403)
return send_from_directory( return send_from_directory(