mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	settings update
This commit is contained in:
		@@ -4,7 +4,7 @@ from threading import Thread
 | 
			
		||||
import os
 | 
			
		||||
from app import db
 | 
			
		||||
from app.decorators import content_negotiation
 | 
			
		||||
from app.models import Avatar, User
 | 
			
		||||
from app.models import Avatar, User, ProfilePrivacySettings
 | 
			
		||||
from . import bp
 | 
			
		||||
 | 
			
		||||
@bp.route('/<hashid:user_id>', methods=['DELETE'])
 | 
			
		||||
@@ -71,3 +71,28 @@ def update_user_is_public(user_id):
 | 
			
		||||
        'category': 'corpus'
 | 
			
		||||
    }
 | 
			
		||||
    return response_data, 200
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# @bp.route('/<hashid:user_id>/profile-privacy-settings', methods=['PUT'])
 | 
			
		||||
# @login_required
 | 
			
		||||
# @content_negotiation(consumes='application/json', produces='application/json')
 | 
			
		||||
# def update_profile_privacy_settings(user_id):
 | 
			
		||||
#     profile_privacy_settings = request.json
 | 
			
		||||
#     if not isinstance(profile_privacy_settings, list):
 | 
			
		||||
#         abort(400)
 | 
			
		||||
#     for profile_privacy_setting in profile_privacy_settings:
 | 
			
		||||
#         if not isinstance(profile_privacy_setting, str):
 | 
			
		||||
#             abort(400)
 | 
			
		||||
#         if not profile_privacy_setting in ProfilePrivacySettings.__members__:
 | 
			
		||||
#             abort(400)
 | 
			
		||||
#     user = User.query.get_or_404(user_id)
 | 
			
		||||
#     user.is_public = is_public
 | 
			
		||||
#     db.session.commit()
 | 
			
		||||
#     response_data = {
 | 
			
		||||
#         'message': (
 | 
			
		||||
#             f'User "{user.username}" is now'
 | 
			
		||||
#             f' {"public" if is_public else "private"}'
 | 
			
		||||
#         ),
 | 
			
		||||
#         'category': 'corpus'
 | 
			
		||||
#     }
 | 
			
		||||
#     return response_data, 200
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user