Improve training test 2
This commit is contained in:
@@ -51,6 +51,14 @@ async def verify_tenant_access(
|
|||||||
db: AsyncSession = Depends(get_db)
|
db: AsyncSession = Depends(get_db)
|
||||||
):
|
):
|
||||||
"""Verify if user has access to tenant - Called by Gateway"""
|
"""Verify if user has access to tenant - Called by Gateway"""
|
||||||
|
# Check if this is a service request
|
||||||
|
if user_id in ["training-service", "data-service", "forecasting-service"]:
|
||||||
|
# Services have access to all tenants for their operations
|
||||||
|
return TenantAccessResponse(
|
||||||
|
has_access=True,
|
||||||
|
role="service",
|
||||||
|
permissions=["read", "write"]
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
access_info = await TenantService.verify_user_access(user_id, tenant_id, db)
|
access_info = await TenantService.verify_user_access(user_id, tenant_id, db)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class DateAlignmentService:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.MAX_TRAINING_RANGE_DAYS = 365 # Maximum training data range
|
self.MAX_TRAINING_RANGE_DAYS = 730 # Maximum training data range
|
||||||
self.MIN_TRAINING_RANGE_DAYS = 30 # Minimum viable training data
|
self.MIN_TRAINING_RANGE_DAYS = 30 # Minimum viable training data
|
||||||
|
|
||||||
def validate_and_align_dates(
|
def validate_and_align_dates(
|
||||||
|
|||||||
Reference in New Issue
Block a user