mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Fix ID/Hashid Problem
This commit is contained in:
		@@ -33,13 +33,16 @@ def profile(user_id):
 | 
				
			|||||||
        abort(403)
 | 
					        abort(403)
 | 
				
			||||||
    return render_template(
 | 
					    return render_template(
 | 
				
			||||||
        'profile/profile.html.j2', 
 | 
					        'profile/profile.html.j2', 
 | 
				
			||||||
        user=user.to_json_serializeable()
 | 
					        user=user.to_json_serializeable(),
 | 
				
			||||||
 | 
					        user_id=user_id
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@bp.route('/<hashid:user_id>/avatar')
 | 
					@bp.route('/<hashid:user_id>/avatar')
 | 
				
			||||||
def profile_avatar(user_id):
 | 
					def profile_avatar(user_id):
 | 
				
			||||||
 | 
					    print(user_id)
 | 
				
			||||||
    user = User.query.get_or_404(user_id)
 | 
					    user = User.query.get_or_404(user_id)
 | 
				
			||||||
 | 
					    print(user)
 | 
				
			||||||
    if user.avatar is None:
 | 
					    if user.avatar is None:
 | 
				
			||||||
        abort(404)
 | 
					        abort(404)
 | 
				
			||||||
    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()):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,7 @@
 | 
				
			|||||||
                <br>
 | 
					                <br>
 | 
				
			||||||
                <br>
 | 
					                <br>
 | 
				
			||||||
                {% if user.avatar %}
 | 
					                {% 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 %}
 | 
					                {% else %}
 | 
				
			||||||
                <img src="{{ url_for('static', filename='images/user_avatar.png') }}" alt="user-image" class="circle responsive-img">
 | 
					                <img src="{{ url_for('static', filename='images/user_avatar.png') }}" alt="user-image" class="circle responsive-img">
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user