File size: 282 Bytes
beadfdf
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from fastapi import Depends, HTTPException

from eval_entity_registry.config import settings


def check_writable():
    if settings.read_only:
        raise HTTPException(status_code=405, detail="Write operations disabled in read-only mode")


writable = [Depends(check_writable)]