6077f685e0
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Remove endpoints api/login/token and api/login/profile --------- Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #89
27 lines
678 B
Python
27 lines
678 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from src.db.models.admin import Assignment
|
|
|
|
|
|
class AssignmentResponse(BaseModel):
|
|
id: str
|
|
created_date: datetime
|
|
last_modified_date: datetime
|
|
version: int
|
|
profile_id: str
|
|
permission_id: str
|
|
|
|
|
|
def to_response(assignment: Assignment) -> AssignmentResponse:
|
|
response: AssignmentResponse = AssignmentResponse(
|
|
id=assignment.id,
|
|
created_date=assignment.created_date,
|
|
last_modified_date=assignment.last_modified_date,
|
|
version=assignment.version,
|
|
profile_id=assignment.profile_id,
|
|
permission_id=assignment.permission_id
|
|
)
|
|
return response
|