Skip to content

Commit 9f4dd77

Browse files
chore: webhook, comments migration (#6523)
* chore: migration changes * chore: renamed the display value * chore: reverted the accounts code
1 parent 0deec92 commit 9f4dd77

File tree

7 files changed

+44
-8
lines changed

7 files changed

+44
-8
lines changed

apiserver/plane/app/views/webhook/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class WebhookLogsEndpoint(BaseAPIView):
120120
@allow_permission(allowed_roles=[ROLE.ADMIN], level="WORKSPACE")
121121
def get(self, request, slug, webhook_id):
122122
webhook_logs = WebhookLog.objects.filter(
123-
workspace__slug=slug, webhook_id=webhook_id
123+
workspace__slug=slug, webhook=webhook_id
124124
)
125125
serializer = WebhookLogSerializer(webhook_logs, many=True)
126126
return Response(serializer.data, status=status.HTTP_200_OK)

apiserver/plane/bgtasks/webhook_task.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def webhook_task(self, webhook, slug, event, event_data, action, current_site):
136136
# Log the webhook request
137137
WebhookLog.objects.create(
138138
workspace_id=str(webhook.workspace_id),
139-
webhook_id=str(webhook.id),
139+
webhook=str(webhook.id),
140140
event_type=str(event),
141141
request_method=str(action),
142142
request_headers=str(headers),
@@ -153,7 +153,7 @@ def webhook_task(self, webhook, slug, event, event_data, action, current_site):
153153
# Log the failed webhook request
154154
WebhookLog.objects.create(
155155
workspace_id=str(webhook.workspace_id),
156-
webhook_id=str(webhook.id),
156+
webhook=str(webhook.id),
157157
event_type=str(event),
158158
request_method=str(action),
159159
request_headers=str(headers),
@@ -304,7 +304,7 @@ def webhook_send_task(
304304
# Log the webhook request
305305
WebhookLog.objects.create(
306306
workspace_id=str(webhook.workspace_id),
307-
webhook_id=str(webhook.id),
307+
webhook=str(webhook.id),
308308
event_type=str(event),
309309
request_method=str(action),
310310
request_headers=str(headers),
@@ -319,7 +319,7 @@ def webhook_send_task(
319319
# Log the failed webhook request
320320
WebhookLog.objects.create(
321321
workspace_id=str(webhook.workspace_id),
322-
webhook_id=str(webhook.id),
322+
webhook=str(webhook.id),
323323
event_type=str(event),
324324
request_method=str(action),
325325
request_headers=str(headers),
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generated by Django 4.2.17 on 2025-01-30 16:08
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('db', '0090_rename_dashboard_deprecateddashboard_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='issuecomment',
15+
name='edited_at',
16+
field=models.DateTimeField(blank=True, null=True),
17+
),
18+
migrations.AddField(
19+
model_name='profile',
20+
name='is_smooth_cursor_enabled',
21+
field=models.BooleanField(default=False),
22+
),
23+
migrations.AlterField(
24+
model_name='userrecentvisit',
25+
name='entity_name',
26+
field=models.CharField(max_length=30),
27+
),
28+
migrations.AlterField(
29+
model_name='webhooklog',
30+
name='webhook',
31+
field=models.UUIDField(),
32+
)
33+
]

apiserver/plane/db/models/issue.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ class IssueComment(ProjectBaseModel):
467467
)
468468
external_source = models.CharField(max_length=255, null=True, blank=True)
469469
external_id = models.CharField(max_length=255, blank=True, null=True)
470+
edited_at = models.DateTimeField(null=True, blank=True)
470471

471472
def save(self, *args, **kwargs):
472473
self.comment_stripped = (

apiserver/plane/db/models/recent_visit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class EntityNameEnum(models.TextChoices):
1717

1818
class UserRecentVisit(WorkspaceBaseModel):
1919
entity_identifier = models.UUIDField(null=True)
20-
entity_name = models.CharField(max_length=30, choices=EntityNameEnum.choices)
20+
entity_name = models.CharField(max_length=30)
2121
user = models.ForeignKey(
2222
settings.AUTH_USER_MODEL,
2323
on_delete=models.CASCADE,

apiserver/plane/db/models/user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ class Profile(TimeAuditModel):
186186
billing_address = models.JSONField(null=True)
187187
has_billing_address = models.BooleanField(default=False)
188188
company_name = models.CharField(max_length=255, blank=True)
189+
190+
is_smooth_cursor_enabled = models.BooleanField(default=False)
189191
# mobile
190192
is_mobile_onboarded = models.BooleanField(default=False)
191193
mobile_onboarding_step = models.JSONField(default=get_mobile_default_onboarding)

apiserver/plane/db/models/webhook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class WebhookLog(BaseModel):
6666
"db.Workspace", on_delete=models.CASCADE, related_name="webhook_logs"
6767
)
6868
# Associated webhook
69-
webhook = models.ForeignKey(Webhook, on_delete=models.CASCADE, related_name="logs")
69+
webhook = models.UUIDField()
7070

7171
# Basic request details
7272
event_type = models.CharField(max_length=255, blank=True, null=True)
@@ -89,4 +89,4 @@ class Meta:
8989
ordering = ("-created_at",)
9090

9191
def __str__(self):
92-
return f"{self.event_type} {str(self.webhook.url)}"
92+
return f"{self.event_type} {str(self.webhook)}"

0 commit comments

Comments
 (0)