resolve flake8 errors
This commit is contained in:
parent
97135c90a5
commit
bda78d892a
|
@ -4,6 +4,5 @@ from django.apps import AppConfig
|
|||
class RestreamConfig(AppConfig):
|
||||
name = 'restream'
|
||||
|
||||
|
||||
def ready(self):
|
||||
import restream.signals # noqa
|
||||
|
|
|
@ -2,7 +2,8 @@ from django.db import models
|
|||
|
||||
# Create your models here.
|
||||
|
||||
from srs.models import Application, Streamkey
|
||||
from srs.models import Streamkey
|
||||
|
||||
|
||||
class RestreamConfig(models.Model):
|
||||
streamkey = models.ForeignKey(Streamkey, on_delete=models.CASCADE)
|
||||
|
|
|
@ -10,11 +10,13 @@ from srs.models import Streamkey
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@receiver(on_unpublish)
|
||||
def callback_on_unpublish(sender, **kwargs):
|
||||
logger.info("stop publish - {}".format(kwargs['name']))
|
||||
celery.send_task('main.stop_restream', kwargs={'name': kwargs['name']})
|
||||
|
||||
|
||||
@receiver(on_publish)
|
||||
def callback_on_publish(sender, **kwargs):
|
||||
logger.info("start publish - {}".format(kwargs['name']))
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
from django.test import TestCase
|
||||
from django.test import TestCase # noqa
|
||||
|
||||
# Create your tests here.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
from django.shortcuts import render # noqa
|
||||
|
||||
# Create your views here.
|
||||
|
|
|
@ -14,6 +14,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name='streamkey',
|
||||
name='key',
|
||||
field=models.CharField(default=uuid.UUID('b5777854-4533-49dc-b38d-69738d8844d6'), max_length=64, unique=True),
|
||||
field=models.CharField(default=uuid.UUID('b5777854-4533-49dc-b38d-69738d8844d6'),
|
||||
max_length=64, unique=True),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
from django.db import models
|
||||
from django.conf import settings
|
||||
import uuid
|
||||
|
||||
from . import signals
|
||||
|
||||
|
||||
class Application(models.Model):
|
||||
name = models.CharField(max_length=100, unique=True)
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
from django.test import TestCase
|
||||
from django.test import TestCase # noqa
|
||||
|
||||
# Create your tests here.
|
||||
|
|
|
@ -2,7 +2,6 @@ import json
|
|||
import logging
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
|
@ -10,6 +9,7 @@ from . import models
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def callback(request):
|
||||
if request.method != 'POST':
|
||||
|
|
Loading…
Reference in New Issue