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

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

Solution #713

wants to merge 2 commits into from

Conversation

sumseer
Copy link

@sumseer sumseer commented Dec 16, 2024

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.


Thank you for your hard work on this project! There are a couple of critical issues that need to be addressed before we can approve the pull request:

  1. Namespace Definition: Ensure that the urls.py files in both the cinema and user apps have the correct namespaces defined (namespace="cinema" and namespace="user"). This is crucial for the include function to work properly with namespaces and ensure that URL routing functions as expected.

  2. OrderViewSet Queryset: In the OrderViewSet, the get_queryset method should use self.queryset instead of directly querying Order.objects. This change will maintain consistency and allow for easier modifications in the future if the queryset needs to be altered. Please update the line return Order.objects.filter(user=self.request.user) to return self.queryset.filter(user=self.request.user).

Once these changes are made, your code will be in great shape! Keep up the excellent work, and don't hesitate to reach out if you have any questions or 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
Comment on lines 170 to 171
def get_queryset(self):
return Order.objects.filter(user=self.request.user)

Choose a reason for hiding this comment

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

The get_queryset method should use self.queryset instead of directly querying Order.objects. This ensures consistency and allows for easier modifications if the queryset is changed in the future. Consider changing return Order.objects.filter(user=self.request.user) to return self.queryset.filter(user=self.request.user).

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

Ensure that the cinema and user apps have urls.py files with the correct namespaces defined (namespace="cinema" and namespace="user"). This is necessary for the include function to work properly with namespaces.

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 addressing most of the issues in your code! 🎉 Your implementation is well-structured, and you've made significant progress. However, there are a few critical areas to focus on:

  1. Namespace Definition: Ensure that the urls.py files in both the cinema and user apps have the correct namespaces defined (namespace="cinema" and namespace="user"). This is crucial for the include function to work properly with namespaces and ensure that URL routing functions as expected.

  2. OrderViewSet Queryset: In the OrderViewSet, the get_queryset method should use self.queryset instead of directly querying Order.objects. Update the line to return self.queryset.filter(user=self.request.user) to maintain consistency and allow for easier modifications in the future.

These adjustments are important for the functionality and maintainability of your code. Keep up the good work, and make sure to address these points in your future iterations. Your dedication to learning and improving is commendable! 🚀

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

Comment on lines 170 to +171
def get_queryset(self):
return Order.objects.filter(user=self.request.user)
return self.queryset.filter(user=self.request.user)

Choose a reason for hiding this comment

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

In the OrderViewSet, the get_queryset method should use self.queryset instead of directly querying Order.objects. Update the line to return self.queryset.filter(user=self.request.user) to maintain consistency and allow for easier modifications in the future.

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

Ensure that the urls.py files in both the cinema and user apps have the correct namespaces defined (namespace="cinema" and namespace="user"). This is crucial for the include function to work properly with namespaces and ensure that URL routing functions as expected.

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