feat: project preferences (#1652)

This commit is contained in:
Nikhil 2023-07-25 14:22:54 +05:30 committed by GitHub
parent 679c97bbe3
commit 998fab80b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,13 @@ def get_default_props():
"showEmptyGroups": True, "showEmptyGroups": True,
} }
def get_default_preferences():
return {
"pages": {
"block_display": True
}
}
class Project(BaseModel): class Project(BaseModel):
NETWORK_CHOICES = ((0, "Secret"), (2, "Public")) NETWORK_CHOICES = ((0, "Secret"), (2, "Public"))
@ -147,6 +154,7 @@ class ProjectMember(ProjectBaseModel):
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=10) role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=10)
view_props = models.JSONField(default=get_default_props) view_props = models.JSONField(default=get_default_props)
default_props = models.JSONField(default=get_default_props) default_props = models.JSONField(default=get_default_props)
preferences = models.JSONField(default=get_default_preferences)
class Meta: class Meta:
unique_together = ["project", "member"] unique_together = ["project", "member"]