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 #741

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Solution #741

wants to merge 7 commits into from

Conversation

FursykIvan
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 task requirements! 🎉 Your code meets the core functionality and aligns well with Django REST Framework practices. There are a few minor improvements suggested, such as ensuring no database files are pushed to the repository and refining the condition for checking actions in viewsets. Keep up the good work, and consider these suggestions for future enhancements. Well done! 👏

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

if self.action == "retrieve":
return MovieDetailSerializer

return MovieSerializer

def get_queryset(self):
queryset = super().get_queryset()
if self.action == ("list", "retrieve"):

Choose a reason for hiding this comment

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

The condition if self.action == ("list", "retrieve"): is incorrect. The self.action attribute is a string, so it should be compared to a single string value, not a tuple. Consider using if self.action in ["list", "retrieve"]: to check if the action is either 'list' or 'retrieve'.

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