refactor [server]: linter
This commit is contained in:
parent
f14987a804
commit
708c18dc67
4 changed files with 7 additions and 6 deletions
|
@ -8,10 +8,10 @@ class ModelFieldLazyChoice(factory.LazyFunction):
|
|||
def __init__(self, model_class, field, *args, **kwargs):
|
||||
choices = [choice[0] for choice in model_class._meta.get_field(field).choices]
|
||||
super(ModelFieldLazyChoice, self).__init__(
|
||||
function=lambda: random.choice(choices),
|
||||
*args, **kwargs
|
||||
function=lambda: random.choice(choices), *args, **kwargs
|
||||
)
|
||||
|
||||
|
||||
class FilmFactory(factory.django.DjangoModelFactory):
|
||||
class Meta:
|
||||
model = Film
|
||||
|
|
|
@ -25,10 +25,11 @@ class Film(models.Model):
|
|||
release_year = models.SmallIntegerField(null=True, blank=True)
|
||||
trailer_link = models.URLField(null=True, blank=True)
|
||||
is_in_color = models.BooleanField(null=True, blank=True)
|
||||
movie_format = models.CharField(max_length=20, choices=MovieFormat.choices, null=True, blank=True)
|
||||
movie_format = models.CharField(
|
||||
max_length=20, choices=MovieFormat.choices, null=True, blank=True
|
||||
)
|
||||
language_subtitles = models.CharField(
|
||||
max_length=20, choices=LanguageSubtitles.choices,
|
||||
null=True, blank=True
|
||||
max_length=20, choices=LanguageSubtitles.choices, null=True, blank=True
|
||||
)
|
||||
poster_link = models.URLField(null=True, blank=True)
|
||||
banner_link = models.URLField(null=True, blank=True)
|
||||
|
|
|
@ -13,7 +13,6 @@ class MoreFieldsModelSerializer(serializers.ModelSerializer):
|
|||
|
||||
|
||||
class FilmSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Film
|
||||
fields = "__all__" #
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
|
||||
IS_LOCAL_DEV = bool(os.environ.get("TELESCOOP_DEV"))
|
||||
if IS_LOCAL_DEV:
|
||||
from .dev import *
|
||||
|
|
Loading…
Add table
Reference in a new issue