File tree Expand file tree Collapse file tree
src/sum_impact_assessment/api/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,16 +28,16 @@ def check_non_production_environment():
2828 Raises:
2929 HTTPException: 403 Forbidden if ENV is 'production'
3030 """
31- if settings .ENV .lower () == "production" :
32- logger . warning (
33- "Attempted to access simulation endpoint in production environment" ,
34- extra = { "env" : settings . ENV }
35- )
36- raise HTTPException (
37- status_code = status . HTTP_403_FORBIDDEN ,
38- detail = "Simulation endpoints are not available in production environment"
39- )
40- return True
31+ if settings .ENV .lower () != "production" and settings . DB_NAME != "sumodp " :
32+ return True
33+ logger . warning (
34+ "Attempted to access simulation endpoint in production environment" ,
35+ extra = { "env" : settings . ENV }
36+ )
37+ raise HTTPException (
38+ status_code = status . HTTP_403_FORBIDDEN ,
39+ detail = "Simulation endpoints are not available in production environment"
40+ )
4141
4242
4343class SimulateKPIResultsRequest (BaseModel ):
@@ -238,6 +238,7 @@ def get_environment_status():
238238
239239 return {
240240 "environment" : settings .ENV ,
241+ "db_name" : settings .DB_NAME ,
241242 "simulation_endpoints_enabled" : not is_production ,
242243 "message" : "Simulation endpoints disabled" if is_production else "Simulation endpoints enabled"
243244 }
You can’t perform that action at this time.
0 commit comments