Skip to content

Commit a403607

Browse files
committed
read and write to API
1 parent 9fe243b commit a403607

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fixbackend/auth/schemas.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,15 @@ class UserNotificationSettingsRead(BaseModel):
8080
weekly_report: bool = Field(description="Whether to receive a weekly report")
8181
inactivity_reminder: bool = Field(description="Whether to receive a reminder for open incidents")
8282
tutorial: bool = Field(description="Whether to receive tutorial emails")
83+
marketing: bool = Field(description="Whether to receive marketing emails")
8384

8485
@staticmethod
8586
def from_model(model: UserNotificationSettings) -> "UserNotificationSettingsRead":
8687
return UserNotificationSettingsRead(
8788
weekly_report=model.weekly_report,
8889
inactivity_reminder=model.inactivity_reminder,
8990
tutorial=model.tutorial,
91+
marketing=model.marketing,
9092
)
9193

9294
def to_model(self, user_id: UserId) -> UserNotificationSettings:
@@ -95,6 +97,7 @@ def to_model(self, user_id: UserId) -> UserNotificationSettings:
9597
weekly_report=self.weekly_report,
9698
inactivity_reminder=self.inactivity_reminder,
9799
tutorial=self.tutorial,
100+
marketing=self.marketing,
98101
)
99102

100103

@@ -104,6 +107,7 @@ class UserNotificationSettingsWrite(BaseModel):
104107
default=None, description="Whether to receive a reminder for open incidents"
105108
)
106109
tutorial: Optional[bool] = Field(default=None, description="Whether to receive tutorial emails")
110+
marketing: Optional[bool] = Field(default=None, description="Whether to receive marketing emails")
107111

108112

109113
class OTPConfig(BaseModel):

0 commit comments

Comments
 (0)