-
Notifications
You must be signed in to change notification settings - Fork 707
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
base: master
Are you sure you want to change the base?
Solution #740
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
return Response( | ||
{"error": "Invalid date format. Please use YYYY-MM-DD."}, | ||
status=status.HTTP_400_BAD_REQUEST | ||
) |
There was a problem hiding this comment.
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.
return Response( | ||
{"error": "Invalid movie ID. Please provide an integer."}, | ||
status=status.HTTP_400_BAD_REQUEST | ||
) |
There was a problem hiding this comment.
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.
No description provided.