mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-08-01 14:30:16 +00:00
Properly populate default values.
This commit is contained in:
parent
b4ae6911c9
commit
2f91e0ce1c
1 changed files with 14 additions and 0 deletions
|
|
@ -3,6 +3,19 @@
|
|||
from django.db import migrations, models
|
||||
|
||||
|
||||
def create_default_proxy_settings(apps, schema_editor):
|
||||
"""Create the default ProxySettings instance"""
|
||||
ProxySettings = apps.get_model("core", "ProxySettings")
|
||||
ProxySettings.objects.create(
|
||||
id=1, # Force singleton ID
|
||||
buffering_timeout=15,
|
||||
buffering_speed=1.0,
|
||||
redis_chunk_ttl=60,
|
||||
channel_shutdown_delay=0,
|
||||
channel_init_grace_period=5,
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
|
|
@ -27,4 +40,5 @@ class Migration(migrations.Migration):
|
|||
'verbose_name_plural': 'Proxy Settings',
|
||||
},
|
||||
),
|
||||
migrations.RunPython(create_default_proxy_settings),
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue