voip click2calll
This commit is contained in:
1 parent
cb92abbb41
commit
38b1cf06df
18 files changed
+543
-26
No files matched your search
@@ -0,0 +1,42 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def copy_staff_mobile_to_voip(apps, schema_editor):
|
||||
User = apps.get_model("accounts", "User")
|
||||
User.objects.filter(account_type="STAFF", voip_mobile="", mobile__isnull=False).exclude(mobile="").update(
|
||||
voip_mobile=models.F("mobile")
|
||||
)
|
||||
|
||||
|
||||
def clear_copied_voip_mobile(apps, schema_editor):
|
||||
User = apps.get_model("accounts", "User")
|
||||
User.objects.filter(account_type="STAFF", voip_mobile=models.F("mobile")).update(voip_mobile="")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [("accounts", "0006_user_voip_call_user_voip_extension_and_more")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="voip_mobile",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
help_text="مستقل از شماره حساب مشتری است و میتواند تکراری باشد.",
|
||||
max_length=16,
|
||||
verbose_name="شماره موبایل کارشناس برای VOIP",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="user",
|
||||
name="mobile",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
max_length=16,
|
||||
null=True,
|
||||
unique=True,
|
||||
verbose_name="شماره موبایل حساب",
|
||||
),
|
||||
),
|
||||
migrations.RunPython(copy_staff_mobile_to_voip, clear_copied_voip_mobile),
|
||||
]
|
||||
Reference in new issue
Block a user