first
This commit is contained in:
commit
fa9d154db9
260 files changed
+17643
No files matched your search
@@ -0,0 +1,31 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def seed_policy(apps, schema_editor):
|
||||
apps.get_model("notifications", "NotificationPolicy").objects.get_or_create(
|
||||
key="STAFF_REPLY_SMS",
|
||||
defaults={"quiet_period_seconds": 300, "is_active": True},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [("notifications", "0002_smstemplate")]
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="NotificationPolicy",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("key", models.CharField(choices=[("STAFF_REPLY_SMS", "پیامک پاسخ کارشناس")], max_length=50, unique=True)),
|
||||
("quiet_period_seconds", models.PositiveIntegerField(default=300, help_text="پس از آخرین فعالیت تیکت، چند ثانیه برای ادامه گفتوگو صبر شود.")),
|
||||
("is_active", models.BooleanField(default=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={"verbose_name": "سیاست اعلان", "verbose_name_plural": "سیاستهای اعلان"},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="notificationjob",
|
||||
name="status",
|
||||
field=models.CharField(choices=[("PENDING", "در صف"), ("PROCESSING", "در حال ارسال"), ("SENT", "ارسالشده"), ("FAILED", "ناموفق"), ("CANCELLED", "لغوشده")], db_index=True, default="PENDING", max_length=15),
|
||||
),
|
||||
migrations.RunPython(seed_policy, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in new issue
Block a user