diff --git a/cinema/serializers.py b/cinema/serializers.py index f688348e4..5fd76d81f 100644 --- a/cinema/serializers.py +++ b/cinema/serializers.py @@ -47,8 +47,12 @@ def create(self, validated_data): return Actor.objects.create(**validated_data) def update(self, instance, validated_data): - instance.first_name = validated_data.get("first_name", instance.first_name) - instance.last_name = validated_data.get("last_name", instance.last_name) + instance.first_name = validated_data.get( + "first_name", instance.first_name + ) + instance.last_name = validated_data.get( + "last_name", instance.last_name + ) instance.save() @@ -67,7 +71,9 @@ def create(self, validated_data): def update(self, instance, validated_data): instance.name = validated_data.get("name", instance.name) instance.rows = validated_data.get("rows", instance.rows) - instance.seats_in_row = validated_data.get("seats_in_row", instance.seats_in_row) + instance.seats_in_row = validated_data.get( + "seats_in_row", instance.seats_in_row + ) instance.save() diff --git a/cinema/urls.py b/cinema/urls.py index 7e4d959bc..06225dc1d 100644 --- a/cinema/urls.py +++ b/cinema/urls.py @@ -26,13 +26,17 @@ router.register("movies", MovieViewSet) urlpatterns = [ + path("", include(router.urls)), path("genres/", GenreList.as_view(), name="genre-list"), path("genres//", GenreDetail.as_view(), name="genre-detail"), path("actors/", ActorList.as_view(), name="actor-list"), path("actors//", ActorDetail.as_view(), name="actor-detail"), path("cinema_halls/", cinema_hall_list, name="cinema-hall-list"), - path("cinema_halls//", cinema_hall_detail, name="cinema-hall-detail"), - path("", include(router.urls)) + path( + "cinema_halls//", + cinema_hall_detail, + name="cinema-hall-detail" + ), ] app_name = "cinema"