fix part 3
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Board sharing API endpoints."""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from uuid import UUID
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
@@ -54,7 +54,7 @@ def validate_share_link(token: str, db: Session, required_permission: str = "vie
|
||||
)
|
||||
|
||||
# Check expiration
|
||||
if share_link.expires_at and share_link.expires_at < datetime.now(timezone.utc):
|
||||
if share_link.expires_at and share_link.expires_at < datetime.now(UTC):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Share link has expired",
|
||||
@@ -69,7 +69,7 @@ def validate_share_link(token: str, db: Session, required_permission: str = "vie
|
||||
|
||||
# Update access tracking
|
||||
share_link.access_count += 1
|
||||
share_link.last_accessed_at = datetime.now(timezone.utc)
|
||||
share_link.last_accessed_at = datetime.now(UTC)
|
||||
db.commit()
|
||||
|
||||
return share_link
|
||||
|
||||
Reference in New Issue
Block a user