[WEB-5044] fix: ruff lint and format errors (#7868)
* fix: lint errors * fix: file formatting * fix: code refactor
This commit is contained in:
parent
1fb22bd252
commit
9237f568dd
261 changed files with 2199 additions and 6378 deletions
|
|
@ -7,12 +7,8 @@ from .base import BaseModel
|
|||
|
||||
|
||||
class Notification(BaseModel):
|
||||
workspace = models.ForeignKey(
|
||||
"db.Workspace", related_name="notifications", on_delete=models.CASCADE
|
||||
)
|
||||
project = models.ForeignKey(
|
||||
"db.Project", related_name="notifications", on_delete=models.CASCADE, null=True
|
||||
)
|
||||
workspace = models.ForeignKey("db.Workspace", related_name="notifications", on_delete=models.CASCADE)
|
||||
project = models.ForeignKey("db.Project", related_name="notifications", on_delete=models.CASCADE, null=True)
|
||||
data = models.JSONField(null=True)
|
||||
entity_identifier = models.UUIDField(null=True)
|
||||
entity_name = models.CharField(max_length=255)
|
||||
|
|
@ -27,9 +23,7 @@ class Notification(BaseModel):
|
|||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
)
|
||||
receiver = models.ForeignKey(
|
||||
"db.User", related_name="received_notifications", on_delete=models.CASCADE
|
||||
)
|
||||
receiver = models.ForeignKey("db.User", related_name="received_notifications", on_delete=models.CASCADE)
|
||||
read_at = models.DateTimeField(null=True)
|
||||
snoozed_till = models.DateTimeField(null=True)
|
||||
archived_at = models.DateTimeField(null=True)
|
||||
|
|
@ -40,9 +34,7 @@ class Notification(BaseModel):
|
|||
db_table = "notifications"
|
||||
ordering = ("-created_at",)
|
||||
indexes = [
|
||||
models.Index(
|
||||
fields=["entity_identifier"], name="notif_entity_identifier_idx"
|
||||
),
|
||||
models.Index(fields=["entity_identifier"], name="notif_entity_identifier_idx"),
|
||||
models.Index(fields=["entity_name"], name="notif_entity_name_idx"),
|
||||
models.Index(fields=["read_at"], name="notif_read_at_idx"),
|
||||
models.Index(fields=["receiver", "read_at"], name="notif_entity_idx"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue