MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / update

Method update

apps/channels/api_views.py:654–665  ·  view source on GitHub ↗

Override update to check M3U associations

(self, request, *args, **kwargs)

Source from the content-addressed store, hash-verified

652 return Response(serializer.data)
653
654 def update(self, request, *args, **kwargs):
655 """Override update to check M3U associations"""
656 instance = self.get_object()
657
658 # Check if group has M3U account associations
659 if hasattr(instance, 'm3u_account') and instance.m3u_account.exists():
660 return Response(
661 {"error": "Cannot edit group with M3U account associations"},
662 status=status.HTTP_400_BAD_REQUEST
663 )
664
665 return super().update(request, *args, **kwargs)
666
667 def partial_update(self, request, *args, **kwargs):
668 """Override partial_update to check M3U associations"""

Callers

nothing calls this directly

Calls 2

existsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected