-
Notifications
You must be signed in to change notification settings - Fork 693
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 #708
base: master
Are you sure you want to change the base?
solution #708
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.
all correct
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.
Thank you for your hard work on this project! 😊 While your implementation is mostly on point, there are a few critical issues that need to be addressed before we can approve the pull request:
-
File Duplication: There are duplicate files in your submission (
user/views.py
anduser/urls.py
). Please remove these duplicates to keep the codebase clean and organized. -
ViewSet Actions: Ensure that the actions available for each ViewSet strictly follow the task description. For example,
MovieViewSet
should allow list, create, and retrieve actions, but usingReadOnlyModelViewSet
withCreateModelMixin
might cause unexpected behavior. Consider usingModelViewSet
for both read and write operations. -
Authentication and Permissions: Double-check that the authentication and permission classes are correctly applied to restrict actions based on user roles as described in the task.
Once these issues are resolved, your code will be in great shape! Keep up the good work, and don't hesitate to reach out if you need further assistance. 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
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 core functionalities! 🎉 While the code is approved to help you move forward with your learning journey, there are a few areas to improve:
-
Duplicate Files: There are duplicate files in your submission, specifically
user/views.py
anduser/urls.py
. Please remove these duplicates to keep your codebase clean and organized. -
ViewSet Implementation: Ensure that
MovieViewSet
andOrderViewSet
useModelViewSet
instead ofGenericViewSet
to fully support the required actions like list, create, and retrieve. -
Import Statement: Correct the syntax error in your import statement. It should be
from rest_framework.permissions import BasePermission, SAFE_METHODS
. -
Namespace Usage: If you are using namespaces in your URLs, make sure that
cinema.urls
anduser.urls
have theapp_name
attribute defined.
These adjustments are crucial for the functionality and maintainability of your code. Keep up the good work and continue learning from these experiences! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -0,0 +1,13 @@ | |||
from rest_framework.permissions import BasePermission, SAFE_METHODS |
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.
There is a syntax error in the import statement. The correct syntax should be from rest_framework.permissions import BasePermission, SAFE_METHODS
without the slash (/
).
class MovieViewSet( | ||
mixins.CreateModelMixin, | ||
mixins.ListModelMixin, | ||
mixins.RetrieveModelMixin, | ||
GenericViewSet |
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.
The MovieViewSet
should use ModelViewSet
instead of GenericViewSet
to support list, create, and retrieve actions as required by the task description.
class OrderViewSet( | ||
mixins.CreateModelMixin, | ||
mixins.ListModelMixin, | ||
GenericViewSet |
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.
The OrderViewSet
should use ModelViewSet
instead of GenericViewSet
to ensure it supports the required actions (list and create) as per the task description.
@@ -4,5 +4,6 @@ | |||
urlpatterns = [ | |||
path("admin/", admin.site.urls), | |||
path("api/cinema/", include("cinema.urls", namespace="cinema")), | |||
path("api/user/", include("user.urls", namespace="user")), |
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.
The namespace
argument in the include
function should only be used if the included URLconf has an app_name
attribute defined. Ensure that cinema.urls
and user.urls
have app_name
set if you intend to use namespaces.
No description provided.