mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
[WEB-4743] chore: added initiator in automation run (#3959)
* chore: added initiator in automation run * chore: updated the migration file
This commit is contained in:
committed by
GitHub
parent
cac959be92
commit
2ba97e0961
27
apps/api/plane/ee/migrations/0046_automationrun_initiator.py
Normal file
27
apps/api/plane/ee/migrations/0046_automationrun_initiator.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 4.2.22 on 2025-08-21 15:15
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
("ee", "0045_pagecomment_initiative_logo_props_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="automationrun",
|
||||
name="initiator",
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="automation_initiators",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -92,6 +92,7 @@ class Automation(ProjectBaseModel):
|
||||
help_text="The bot user for this automation",
|
||||
)
|
||||
|
||||
|
||||
def can_execute(self):
|
||||
"""Check if automation can be executed"""
|
||||
return (
|
||||
@@ -226,7 +227,6 @@ class AutomationVersion(ProjectBaseModel):
|
||||
default=dict,
|
||||
help_text="Complete automation configuration including nodes and edges",
|
||||
)
|
||||
|
||||
# Metadata
|
||||
is_published = models.BooleanField(default=False)
|
||||
published_at = models.DateTimeField(null=True, blank=True)
|
||||
@@ -411,6 +411,13 @@ class AutomationRun(ProjectBaseModel):
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
initiator = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name="automation_initiators",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def active(cls):
|
||||
|
||||
Reference in New Issue
Block a user