From 8aebe27aa8f8aefa136a4100bb7c383d625e5764 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 14 Mar 2023 11:58:06 +0100 Subject: [PATCH 1/3] Fix wrong route decorator --- app/contributions/spacy_nlp_pipeline_models/json_routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/contributions/spacy_nlp_pipeline_models/json_routes.py b/app/contributions/spacy_nlp_pipeline_models/json_routes.py index af6c62d0..9d05b165 100644 --- a/app/contributions/spacy_nlp_pipeline_models/json_routes.py +++ b/app/contributions/spacy_nlp_pipeline_models/json_routes.py @@ -7,7 +7,7 @@ from app.models import SpaCyNLPPipelineModel from .. import bp -@bp.route('/spacy-nlp-pipeline-models', methods=['DELETE']) +@bp.route('/spacy-nlp-pipeline-models/', methods=['DELETE']) @login_required @content_negotiation(produces='application/json') def delete_spacy_model(spacy_nlp_pipeline_model_id): @@ -32,7 +32,7 @@ def delete_spacy_model(spacy_nlp_pipeline_model_id): return resonse_data, 202 -@bp.route('/spacy-nlp-pipeline-models/is_public', methods=['PUT']) +@bp.route('/spacy-nlp-pipeline-models//is_public', methods=['PUT']) @login_required @permission_required('CONTRIBUTE') @content_negotiation(consumes='application/json', produces='application/json') From 8dba78c474805d1f6de4f490e42ca30979a0c371 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 14 Mar 2023 12:12:05 +0100 Subject: [PATCH 2/3] 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( From b8e63d2342d104a7ac5177297f42eca6f60d55b1 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 14 Mar 2023 12:20:29 +0100 Subject: [PATCH 3/3] Add Icons for users breadcrumbs --- app/users/routes.py | 2 +- app/users/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/users/routes.py b/app/users/routes.py index 64dca884..a69fa503 100644 --- a/app/users/routes.py +++ b/app/users/routes.py @@ -26,7 +26,7 @@ from .utils import ( @bp.route('') -@register_breadcrumb(bp, '.', 'Users') +@register_breadcrumb(bp, '.', 'groupUsers') @login_required def users(): return redirect(url_for('main.social_area', _anchor='users')) diff --git a/app/users/utils.py b/app/users/utils.py index e352fe5c..1c4ab7a8 100644 --- a/app/users/utils.py +++ b/app/users/utils.py @@ -11,7 +11,7 @@ def user_dynamic_list_constructor(): user = User.query.get_or_404(user_id) return [ { - 'text': user.username, + 'text': f'account_circle{user.username}', 'url': url_for('.user', user_id=user_id) } ]