diff --git a/app/contributions/spacy_nlp_pipeline_models/json_routes.py b/app/contributions/spacy_nlp_pipeline_models/json_routes.py index af6c62d0a7781c72c62332bfec90761df0712be5..9d05b165d756a77778557b28ce3f2c81292df49b 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<hashid:spacy_nlp_pipeline_model_id>', methods=['DELETE']) +@bp.route('/spacy-nlp-pipeline-models/<hashid:spacy_nlp_pipeline_model_id>', 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<hashid:spacy_nlp_pipeline_model_id>/is_public', methods=['PUT']) +@bp.route('/spacy-nlp-pipeline-models/<hashid:spacy_nlp_pipeline_model_id>/is_public', methods=['PUT']) @login_required @permission_required('CONTRIBUTE') @content_negotiation(consumes='application/json', produces='application/json') diff --git a/app/users/routes.py b/app/users/routes.py index cd3f2ba4f1f34c8b3b5a3115335ea194c3aff245..a69fa503f0d1b1623f637509d5c29903904158ff 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, '.', '<i class="material-icons left">group</i>Users') @login_required def users(): return redirect(url_for('main.social_area', _anchor='users')) @@ -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( diff --git a/app/users/utils.py b/app/users/utils.py index e352fe5c34d1f9c49f9934ca863700009ca546d9..1c4ab7a8e80ded8ebbf7fe19f744c8cc7669ed8b 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'<i class="material-icons left">account_circle</i>{user.username}', 'url': url_for('.user', user_id=user_id) } ]