From 2f91e0ce1c61acec2e63149133d9ab216612bee6 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 12 Jun 2025 16:02:08 -0500 Subject: [PATCH] Properly populate default values. --- core/migrations/0014_proxysettings.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/migrations/0014_proxysettings.py b/core/migrations/0014_proxysettings.py index 1f50adea..75a3096f 100644 --- a/core/migrations/0014_proxysettings.py +++ b/core/migrations/0014_proxysettings.py @@ -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), ]