-
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 #707
base: master
Are you sure you want to change the base?
solution #707
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.
perfect🔥🔥
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 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! ✨
return request.user.is_authenticated \ | ||
if request.method in permissions.SAFE_METHODS\ | ||
else request.user.is_staff |
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 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.
def get_queryset(self): | ||
return Order.objects.filter(user=self.request.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 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.
No description provided.