Skip to content

Commit 617306d

Browse files
committed
Edit ticket type view model
1 parent 6f652c5 commit 617306d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ticket/view_models.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from dataclasses import asdict, dataclass
2-
from datetime import datetime
32
from typing import Optional, Union
43

54
from program.models import CONFERENCE, TUTORIAL, SPRINT
@@ -12,8 +11,8 @@ class TicketTypeViewModel:
1211
class Program:
1312
title: str
1413
short_desc: str
15-
start_at: datetime
16-
end_at: datetime
14+
start_at: Optional[str]
15+
end_at: Optional[str]
1716
program_type: str # type: Union[CONFERENCE, TUTORIAL, SPRINT]
1817

1918
id: str
@@ -36,8 +35,8 @@ def __init__(self, model: TicketType):
3635
self.program = TicketTypeViewModel.Program(
3736
title=model.program.title,
3837
short_desc=model.program.short_desc,
39-
start_at=model.program.start_at,
40-
end_at=model.program.end_at,
38+
start_at=model.program.start_at.strftime("%Y-%m-%dT%H:%M:%S"),
39+
end_at=model.program.end_at.strftime("%Y-%m-%dT%H:%M:%S"),
4140
program_type=model.program.program_type,
4241
)
4342
self.is_refundable = model.is_refundable

0 commit comments

Comments
 (0)