Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
o-davydova committed Nov 2, 2023
1 parent b326cec commit ca2bdc6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions cinema/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand Down
8 changes: 6 additions & 2 deletions cinema/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@
router.register("movies", MovieViewSet)

urlpatterns = [
path("", include(router.urls)),
path("genres/", GenreList.as_view(), name="genre-list"),
path("genres/<int:pk>/", GenreDetail.as_view(), name="genre-detail"),
path("actors/", ActorList.as_view(), name="actor-list"),
path("actors/<int:pk>/", ActorDetail.as_view(), name="actor-detail"),
path("cinema_halls/", cinema_hall_list, name="cinema-hall-list"),
path("cinema_halls/<int:pk>/", cinema_hall_detail, name="cinema-hall-detail"),
path("", include(router.urls))
path(
"cinema_halls/<int:pk>/",
cinema_hall_detail,
name="cinema-hall-detail"
),
]

app_name = "cinema"

0 comments on commit ca2bdc6

Please sign in to comment.