mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 00:11:16 -05:00
TRying to fix defaults.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -31,7 +31,10 @@ def save_user_attribute(usr, update_dict=None):
|
|||||||
|
|
||||||
|
|
||||||
def save_model_user(
|
def save_model_user(
|
||||||
user, update_dict=None, password=None, validated_email_access=False
|
user,
|
||||||
|
update_dict=None,
|
||||||
|
password=None,
|
||||||
|
validated_email_access=False,
|
||||||
):
|
):
|
||||||
if password:
|
if password:
|
||||||
user.password = password
|
user.password = password
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class User(db.Model):
|
|||||||
state = db.Column(db.String, nullable=False, default="pending")
|
state = db.Column(db.String, nullable=False, default="pending")
|
||||||
platform_admin = db.Column(db.Boolean, nullable=False, default=False)
|
platform_admin = db.Column(db.Boolean, nullable=False, default=False)
|
||||||
current_session_id = db.Column(UUID(as_uuid=True), nullable=True)
|
current_session_id = db.Column(UUID(as_uuid=True), nullable=True)
|
||||||
auth_type = enum_column(AuthType, index=True, nullable=False, default=AuthType.SMS)
|
auth_type = enum_column(AuthType, index=True, nullable=False, default=AuthType.SMS.value)
|
||||||
email_access_validated_at = db.Column(
|
email_access_validated_at = db.Column(
|
||||||
db.DateTime,
|
db.DateTime,
|
||||||
index=False,
|
index=False,
|
||||||
@@ -310,7 +310,7 @@ class EmailBranding(db.Model):
|
|||||||
BrandType,
|
BrandType,
|
||||||
index=True,
|
index=True,
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=BrandType.ORG,
|
default=BrandType.ORG.value,
|
||||||
)
|
)
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
@@ -1130,7 +1130,7 @@ class TemplateBase(db.Model):
|
|||||||
TemplateProcessType,
|
TemplateProcessType,
|
||||||
index=True,
|
index=True,
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=TemplateProcessType.NORMAL,
|
default=TemplateProcessType.NORMAL.value,
|
||||||
)
|
)
|
||||||
|
|
||||||
redact_personalisation = association_proxy(
|
redact_personalisation = association_proxy(
|
||||||
@@ -1385,7 +1385,7 @@ class Job(db.Model):
|
|||||||
JobStatus,
|
JobStatus,
|
||||||
index=True,
|
index=True,
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=JobStatus.PENDING,
|
default=JobStatus.PENDING.value,
|
||||||
)
|
)
|
||||||
archived = db.Column(db.Boolean, nullable=False, default=False)
|
archived = db.Column(db.Boolean, nullable=False, default=False)
|
||||||
|
|
||||||
@@ -1453,7 +1453,7 @@ class NotificationAllTimeView(db.Model):
|
|||||||
NotificationStatus,
|
NotificationStatus,
|
||||||
name="notification_status",
|
name="notification_status",
|
||||||
nullable=True,
|
nullable=True,
|
||||||
default=NotificationStatus.CREATED,
|
default=NotificationStatus.CREATED.value,
|
||||||
key="status",
|
key="status",
|
||||||
)
|
)
|
||||||
reference = db.Column(db.String)
|
reference = db.Column(db.String)
|
||||||
@@ -1511,7 +1511,7 @@ class Notification(db.Model):
|
|||||||
NotificationStatus,
|
NotificationStatus,
|
||||||
name="notification_status",
|
name="notification_status",
|
||||||
nullable=True,
|
nullable=True,
|
||||||
default=NotificationStatus.CREATED,
|
default=NotificationStatus.CREATED.value,
|
||||||
key="status",
|
key="status",
|
||||||
)
|
)
|
||||||
reference = db.Column(db.String, nullable=True, index=True)
|
reference = db.Column(db.String, nullable=True, index=True)
|
||||||
@@ -1788,7 +1788,7 @@ class NotificationHistory(db.Model, HistoryModel):
|
|||||||
NotificationStatus,
|
NotificationStatus,
|
||||||
name="notification_status",
|
name="notification_status",
|
||||||
nullable=True,
|
nullable=True,
|
||||||
default=NotificationStatus.CREATED,
|
default=NotificationStatus.CREATED.value,
|
||||||
key="status",
|
key="status",
|
||||||
)
|
)
|
||||||
reference = db.Column(db.String, nullable=True, index=True)
|
reference = db.Column(db.String, nullable=True, index=True)
|
||||||
@@ -1856,11 +1856,11 @@ class InvitedUser(db.Model):
|
|||||||
status = enum_column(
|
status = enum_column(
|
||||||
InvitedUserStatus,
|
InvitedUserStatus,
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=InvitedUserStatus.PENDING,
|
default=InvitedUserStatus.PENDING.value,
|
||||||
)
|
)
|
||||||
permissions = db.Column(db.String, nullable=False)
|
permissions = db.Column(db.String, nullable=False)
|
||||||
auth_type = enum_column(AuthType, index=True, nullable=False, default=AuthType.SMS)
|
auth_type = enum_column(AuthType, index=True, nullable=False, default=AuthType.SMS.value)
|
||||||
folder_permissions = db.Column(JSONB(none_as_null=True), nullable=False, default=[])
|
folder_permissions = db.Column(JSONB(none_as_null=True), nullable=False, default=list)
|
||||||
|
|
||||||
# would like to have used properties for this but haven't found a way to make them
|
# would like to have used properties for this but haven't found a way to make them
|
||||||
# play nice with marshmallow yet
|
# play nice with marshmallow yet
|
||||||
@@ -1894,7 +1894,7 @@ class InvitedOrganizationUser(db.Model):
|
|||||||
status = enum_column(
|
status = enum_column(
|
||||||
InvitedUserStatus,
|
InvitedUserStatus,
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=InvitedUserStatus.PENDING,
|
default=InvitedUserStatus.PENDING.value,
|
||||||
)
|
)
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user