views.py 614 B

123456789101112131415161718192021
  1. from django.shortcuts import render
  2. # Create your views here.
  3. from webgui.settings import APPLICATION_NAME
  4. from .models import ChannelSettings
  5. from .forms import ChannelSettingsForm
  6. def channel_settings(request, channel_id):
  7. initial_data = {
  8. "interact": ChannelSettings.objects.get(channel=channel_id).interact
  9. }
  10. context = {
  11. 'title': 'Channel settings',
  12. 'icon': 'screwdriver',
  13. 'description': 'Modify channel settings for ' + APPLICATION_NAME,
  14. 'keywords': 'settigns, channel',
  15. 'form': ChannelSettingsForm(initial=initial_data),
  16. }
  17. return render(request, 'config/channel_settings.html', context)