fix(ts-proxy): Remove redundant local import causing UnboundLocalError

The local `from apps.channels.models import Channel` inside a
conditional block in _handle_client_disconnect() shadowed the top-level import. When the condition was False, Python's function-level scoping caused line 462's Channel.objects.get() to raise UnboundLocalError. Channel is already imported at module level (line 11), making the local import unnecessary.

Discovered when testing proxy changes
This commit is contained in:
None 2026-02-11 20:52:30 -06:00
parent 6360271e28
commit 8bb8a0fca9

View file

@ -437,7 +437,6 @@ class StreamGenerator:
client_count = proxy_server.client_managers[self.channel_id].get_total_client_count()
# Only the last client or owner should release the stream
if client_count <= 1 and proxy_server.am_i_owner(self.channel_id):
from apps.channels.models import Channel
try:
# Get the channel by UUID
channel = Channel.objects.get(uuid=self.channel_id)