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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

solution #707

wants to merge 1 commit into from

Conversation

dxrrkwm
Copy link

@dxrrkwm dxrrkwm commented Dec 15, 2024

No description provided.

Copy link

@yulia-pl yulia-pl left a comment

Choose a reason for hiding this comment

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

perfect🔥🔥

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 functionality! 🎉 While there are a few minor improvements suggested, such as refining the get_queryset method and adjusting line continuation syntax, these do not impact the overall functionality of your code. Keep up the good work and consider these suggestions for future enhancements! 😊

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

Comment on lines +6 to +8
return request.user.is_authenticated \
if request.method in permissions.SAFE_METHODS\
else request.user.is_staff

Choose a reason for hiding this comment

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

The line continuation character \ is not needed here. Python automatically joins lines inside parentheses, brackets, and braces. You can remove the backslashes and enclose the entire expression in parentheses for better readability.

Comment on lines +154 to +155
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 in OrderViewSet redefines the queryset with Order.objects.filter(user=self.request.user). Since the queryset attribute is already defined, you can simply filter it instead of redefining it. Consider using self.queryset.filter(user=self.request.user) to maintain consistency and avoid redundancy.

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