mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Fix ID/Hashid Problem
This commit is contained in:
parent
e633b834c6
commit
5e34252cb4
@ -33,13 +33,16 @@ def profile(user_id):
|
||||
abort(403)
|
||||
return render_template(
|
||||
'profile/profile.html.j2',
|
||||
user=user.to_json_serializeable()
|
||||
user=user.to_json_serializeable(),
|
||||
user_id=user_id
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/<hashid:user_id>/avatar')
|
||||
def profile_avatar(user_id):
|
||||
print(user_id)
|
||||
user = User.query.get_or_404(user_id)
|
||||
print(user)
|
||||
if user.avatar is None:
|
||||
abort(404)
|
||||
if not user.is_public and not (user == current_user or current_user.is_administrator()):
|
||||
|
@ -13,7 +13,7 @@
|
||||
<br>
|
||||
<br>
|
||||
{% if user.avatar %}
|
||||
<img src="/profile/{{ user.id }}/avatar" alt="user-image" class="circle responsive-img">
|
||||
<img src="{{ url_for('.profile_avatar', user_id=user_id) }}" alt="user-image" class="circle responsive-img">
|
||||
{% else %}
|
||||
<img src="{{ url_for('static', filename='images/user_avatar.png') }}" alt="user-image" class="circle responsive-img">
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user