sms
This commit is contained in:
1 parent
250cdbab7f
commit
5c6069c3ef
87 files changed
+29209
-3697
No files matched your search
@@ -0,0 +1,35 @@
|
||||
# Generated by Django 3.2.25 on 2026-10-10 07:48
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def scrub_brand(apps, schema_editor):
|
||||
"""حذف نام برند از متن قالبهایی که پیشتر با «کتیبه» ذخیره شدهاند."""
|
||||
SMSTemplate = apps.get_model("admin_panel", "SMSTemplate")
|
||||
for template in SMSTemplate.objects.filter(text__contains="کتیبه"):
|
||||
cleaned = (
|
||||
template.text.replace("به خانواده کتیبه خوش آمدید. ", "")
|
||||
.replace(" نزد کتیبه", "")
|
||||
)
|
||||
template.text = cleaned
|
||||
template.save(update_fields=["text"])
|
||||
|
||||
|
||||
def noop(apps, schema_editor):
|
||||
pass
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('admin_panel', '0064_sms_webservice_delivery'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='smsproviderconfig',
|
||||
name='test_message',
|
||||
field=models.TextField(blank=True, default='پیامک آزمایشی؛ جهت بررسی صحت ارسال از پنل فرستاده شده است.', help_text='متنی که با دکمهٔ «ارسال پیامک آزمایشی» فرستاده میشود؛ قابل ویرایش است.', verbose_name='متن پیامک آزمایشی'),
|
||||
),
|
||||
migrations.RunPython(scrub_brand, noop),
|
||||
]
|
||||
Reference in new issue
Block a user