Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #740

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution #740

wants to merge 1 commit into from

Conversation

zaietsmo
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the cinema application! 🎬 While there are a few minor issues, such as the error handling in MovieSessionViewSet and the create method in OrderSerializer, these do not significantly impact the functionality. Keep up the good work and consider the feedback for future improvements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨



class OrderSerializer(serializers.ModelSerializer):
tickets = TicketSerializer(many=True, read_only=False, allow_empty=False)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the OrderSerializer, the tickets field is set with read_only=False and allow_empty=False. Ensure that the create method properly validates the ticket data before creating Ticket instances to prevent potential data integrity issues.

Comment on lines +115 to +118
return Response(
{"error": "Invalid date format. Please use YYYY-MM-DD."},
status=status.HTTP_400_BAD_REQUEST
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the MovieSessionViewSet, returning a Response object directly from get_queryset is not standard practice. Instead, consider raising a serializers.ValidationError or handling the error in a different method to maintain consistency with the rest of the viewset.

Comment on lines +125 to +128
return Response(
{"error": "Invalid movie ID. Please provide an integer."},
status=status.HTTP_400_BAD_REQUEST
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous comment, returning a Response object directly from get_queryset is not standard. Consider raising a serializers.ValidationError or handling the error in a different method to ensure consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants