fixing mail
This commit is contained in:
@@ -443,8 +443,10 @@ def get_eligible_users(assignment_id: str, db: Session = Depends(get_db), curren
|
||||
return result
|
||||
|
||||
|
||||
from typing import Optional
|
||||
|
||||
class TestEmailRequest(BaseModel):
|
||||
date: date = None
|
||||
date: Optional[date] = None
|
||||
office_id: str
|
||||
|
||||
|
||||
@@ -455,6 +457,7 @@ def send_test_email_tool(data: TestEmailRequest, db: Session = Depends(get_db),
|
||||
from database.models import OfficeClosingDay, OfficeWeeklyClosingDay
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
# Verify office access
|
||||
if current_user.role == UserRole.MANAGER and current_user.office_id != data.office_id:
|
||||
raise HTTPException(status_code=403, detail="Not authorized for this office")
|
||||
|
||||
Reference in New Issue
Block a user