Merge branch 'public-corpus' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into public-corpus

This commit is contained in:
Inga Kirschnick 2023-03-14 13:32:42 +01:00
commit 777151b2bf
3 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ from app.models import SpaCyNLPPipelineModel
from .. import bp 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 @login_required
@content_negotiation(produces='application/json') @content_negotiation(produces='application/json')
def delete_spacy_model(spacy_nlp_pipeline_model_id): 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 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 @login_required
@permission_required('CONTRIBUTE') @permission_required('CONTRIBUTE')
@content_negotiation(consumes='application/json', produces='application/json') @content_negotiation(consumes='application/json', produces='application/json')

View File

@ -26,7 +26,7 @@ from .utils import (
@bp.route('') @bp.route('')
@register_breadcrumb(bp, '.', 'Users') @register_breadcrumb(bp, '.', '<i class="material-icons left">group</i>Users')
@login_required @login_required
def users(): def users():
return redirect(url_for('main.social_area', _anchor='users')) return redirect(url_for('main.social_area', _anchor='users'))
@ -65,7 +65,7 @@ def user(user_id):
def profile_avatar(user_id): def profile_avatar(user_id):
user = User.query.get_or_404(user_id) user = User.query.get_or_404(user_id)
if user.avatar is None: 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()): if not user.is_public and not (user == current_user or current_user.is_administrator()):
abort(403) abort(403)
return send_from_directory( return send_from_directory(

View File

@ -11,7 +11,7 @@ def user_dynamic_list_constructor():
user = User.query.get_or_404(user_id) user = User.query.get_or_404(user_id)
return [ return [
{ {
'text': user.username, 'text': f'<i class="material-icons left">account_circle</i>{user.username}',
'url': url_for('.user', user_id=user_id) 'url': url_for('.user', user_id=user_id)
} }
] ]