Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae01ca4648 | |||
| 739e80d36c | |||
| 41c6575884 | |||
| f155875326 | |||
| d9510fa381 |
+179
@@ -0,0 +1,179 @@
|
||||
# Generated by Django 4.2.16 on 2024-10-14 07:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("db", "0080_fileasset_draft_issue_alter_fileasset_entity_type"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="issuetype",
|
||||
name="external_id",
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="issuetype",
|
||||
name="external_source",
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="property_change",
|
||||
new_name="email_property_change",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_property_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="state_change",
|
||||
new_name="email_state_change",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_state_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="comment",
|
||||
new_name="email_comment",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_comment",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="mention",
|
||||
new_name="email_mention",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_mention",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="issue_completed",
|
||||
new_name="email_issue_completed",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_issue_completed",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="deployboard",
|
||||
name="is_disabled",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_assignee_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_cycle_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_module_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_priority_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_reactions",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_start_target_date_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_assignee_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_comment",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_cycle_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_issue_completed",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_mention",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_module_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_priority_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_property_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_reactions",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_start_target_date_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_state_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="deployboard",
|
||||
name="entity_name",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("project", "Project"),
|
||||
("issue", "Issue"),
|
||||
("module", "Module"),
|
||||
("cycle", "Task"),
|
||||
("page", "Page"),
|
||||
("view", "View"),
|
||||
("inbox", "Inbox"),
|
||||
],
|
||||
max_length=30,
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -34,9 +34,9 @@ class DeployBoard(WorkspaceBaseModel):
|
||||
)
|
||||
is_comments_enabled = models.BooleanField(default=False)
|
||||
is_reactions_enabled = models.BooleanField(default=False)
|
||||
inbox = models.ForeignKey(
|
||||
intake = models.ForeignKey(
|
||||
"db.Inbox",
|
||||
related_name="board_inbox",
|
||||
related_name="board_intake",
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@ from django.db import models
|
||||
from .base import BaseModel
|
||||
|
||||
|
||||
|
||||
class Notification(BaseModel):
|
||||
workspace = models.ForeignKey(
|
||||
"db.Workspace", related_name="notifications", on_delete=models.CASCADE
|
||||
@@ -90,12 +89,24 @@ class UserNotificationPreference(BaseModel):
|
||||
null=True,
|
||||
)
|
||||
|
||||
medium = models.CharField(
|
||||
max_length=50,
|
||||
default="email",
|
||||
choices=(("EMAIL", "Email"), ("IN_APP", "In App")),
|
||||
)
|
||||
|
||||
# preference fields
|
||||
property_change = models.BooleanField(default=True)
|
||||
state_change = models.BooleanField(default=True)
|
||||
comment = models.BooleanField(default=True)
|
||||
mention = models.BooleanField(default=True)
|
||||
issue_completed = models.BooleanField(default=True)
|
||||
property_change = models.BooleanField(default=False)
|
||||
state_change = models.BooleanField(default=False)
|
||||
priority_change = models.BooleanField(default=False)
|
||||
assignee_change = models.BooleanField(default=False)
|
||||
start_target_date_change = models.BooleanField(default=False)
|
||||
module_change = models.BooleanField(default=False)
|
||||
cycle_change = models.BooleanField(default=False)
|
||||
reactions = models.BooleanField(default=False)
|
||||
comment = models.BooleanField(default=False)
|
||||
mention = models.BooleanField(default=False)
|
||||
issue_completed = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "UserNotificationPreference"
|
||||
|
||||
@@ -260,9 +260,4 @@ def create_user_notification(sender, instance, created, **kwargs):
|
||||
|
||||
UserNotificationPreference.objects.create(
|
||||
user=instance,
|
||||
property_change=False,
|
||||
state_change=False,
|
||||
comment=False,
|
||||
mention=False,
|
||||
issue_completed=False,
|
||||
)
|
||||
|
||||
@@ -185,7 +185,6 @@ class OffsetPaginator:
|
||||
|
||||
|
||||
class GroupedOffsetPaginator(OffsetPaginator):
|
||||
|
||||
# Field mappers - list m2m fields here
|
||||
FIELD_MAPPER = {
|
||||
"labels__id": "label_ids",
|
||||
@@ -683,7 +682,7 @@ class SubGroupedOffsetPaginator(OffsetPaginator):
|
||||
# for multi groups
|
||||
result[
|
||||
self.FIELD_MAPPER.get(self.sub_group_by_field_name)
|
||||
] = ([] if "None" in sub_group_ids else sub_group_ids)
|
||||
] = [] if "None" in sub_group_ids else sub_group_ids
|
||||
# If a result belongs to multiple groups, add it to each group
|
||||
processed_results[str(group_value)]["results"][
|
||||
str(sub_group_value)
|
||||
|
||||
Reference in New Issue
Block a user