mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-14 01:50:40 +00:00
Change how the user avatar is exchanged between client und server
This commit is contained in:
@ -64,10 +64,10 @@ def user(user_id):
|
||||
@login_required
|
||||
def profile_avatar(user_id):
|
||||
user = User.query.get_or_404(user_id)
|
||||
if not (user.is_public or user == current_user or current_user.is_administrator()):
|
||||
abort(403)
|
||||
if user.avatar is None:
|
||||
return redirect(url_for('static', filename='images/user_avatar.png'))
|
||||
if not user.is_public and not (user == current_user or current_user.is_administrator()):
|
||||
abort(403)
|
||||
return send_from_directory(
|
||||
os.path.dirname(user.avatar.path),
|
||||
os.path.basename(user.avatar.path),
|
||||
|
Reference in New Issue
Block a user