Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update backend_structured/routes.py
Browse files
backend_structured/routes.py
CHANGED
|
@@ -809,7 +809,7 @@ def manage_single_organization(current_user, org_id):
|
|
| 809 |
db.session.commit()
|
| 810 |
return jsonify({'message': 'Tenant updated successfully'}), 200
|
| 811 |
|
| 812 |
-
@auth_bp.route('/organizations/logo', methods=['POST'])
|
| 813 |
@token_required
|
| 814 |
def upload_organization_logo(current_user):
|
| 815 |
if current_user.role not in ('org_admin', 'super_admin'):
|
|
@@ -818,6 +818,11 @@ def upload_organization_logo(current_user):
|
|
| 818 |
org = db.session.get(Organization, current_user.org_id)
|
| 819 |
if not org:
|
| 820 |
return jsonify({'message': 'Organization not found'}), 404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 821 |
|
| 822 |
file_bytes = None
|
| 823 |
content_type = 'image/png'
|
|
|
|
| 809 |
db.session.commit()
|
| 810 |
return jsonify({'message': 'Tenant updated successfully'}), 200
|
| 811 |
|
| 812 |
+
@auth_bp.route('/organizations/logo', methods=['POST', 'DELETE'])
|
| 813 |
@token_required
|
| 814 |
def upload_organization_logo(current_user):
|
| 815 |
if current_user.role not in ('org_admin', 'super_admin'):
|
|
|
|
| 818 |
org = db.session.get(Organization, current_user.org_id)
|
| 819 |
if not org:
|
| 820 |
return jsonify({'message': 'Organization not found'}), 404
|
| 821 |
+
|
| 822 |
+
if request.method == 'DELETE':
|
| 823 |
+
org.report_logo_url = None
|
| 824 |
+
db.session.commit()
|
| 825 |
+
return jsonify({'message': 'Logo removed successfully', 'report_logo_url': None}), 200
|
| 826 |
|
| 827 |
file_bytes = None
|
| 828 |
content_type = 'image/png'
|