mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
Merge branch 'public-corpus' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into public-corpus
This commit is contained in:
commit
777151b2bf
@ -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')
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user