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

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

solution #708

wants to merge 2 commits into from

Conversation

molodsh1y1
Copy link

No description provided.

Copy link

@YaYaYaroslav YaYaYaroslav left a comment

Choose a reason for hiding this comment

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

all correct

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.


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:

  1. File Duplication: There are duplicate files in your submission (user/views.py and user/urls.py). Please remove these duplicates to keep the codebase clean and organized.

  2. 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 using ReadOnlyModelViewSet with CreateModelMixin might cause unexpected behavior. Consider using ModelViewSet for both read and write operations.

  3. 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.

cinema/views.py Outdated Show resolved Hide resolved
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 core functionalities! 🎉 While the code is approved to help you move forward with your learning journey, there are a few areas to improve:

  1. Duplicate Files: There are duplicate files in your submission, specifically user/views.py and user/urls.py. Please remove these duplicates to keep your codebase clean and organized.

  2. ViewSet Implementation: Ensure that MovieViewSet and OrderViewSet use ModelViewSet instead of GenericViewSet to fully support the required actions like list, create, and retrieve.

  3. Import Statement: Correct the syntax error in your import statement. It should be from rest_framework.permissions import BasePermission, SAFE_METHODS.

  4. Namespace Usage: If you are using namespaces in your URLs, make sure that cinema.urls and user.urls have the app_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

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 (/).

Comment on lines +62 to +66
class MovieViewSet(
mixins.CreateModelMixin,
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
GenericViewSet

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.

Comment on lines +153 to +156
class OrderViewSet(
mixins.CreateModelMixin,
mixins.ListModelMixin,
GenericViewSet

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")),

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.

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