-
Notifications
You must be signed in to change notification settings - Fork 899
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
Develop #934
base: master
Are you sure you want to change the base?
Develop #934
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.
Thank you for your hard work on this project! 😊 While your code is well-structured and follows many best practices, there are a few critical issues that need to be addressed before we can approve the pull request:
-
Use of
User
instead ofget_user_model()
: It's important to useget_user_model()
to ensure flexibility and compatibility with custom user models. Please update your code inservices/user.py
to reflect this best practice. -
Repeated
save()
Calls: In thecreate_user
function, try to minimize the number ofsave()
calls to improve efficiency and adhere to best practices. -
Missing Transaction Decorator: Ensure that the
create_movie
function inservices/movie.py
is wrapped in a transaction using the@transaction.atomic
decorator to maintain data integrity. -
Missing Migrations: Please include migration files in your pull request to ensure that tests can pass and the database schema is up-to-date.
-
File Structure: The
db/models.py
file contains models that are not directly related to the task. Consider removing or relocating this file to maintain focus on the services.
Addressing these issues will help enhance the functionality and maintainability of your code. Keep up the great work, and I'm confident you'll nail it with these adjustments! 🚀
✨ 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.
if date: | ||
order.created_at = date | ||
order.save() |
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.
Setting the created_at
field manually might not be necessary, as it is typically set automatically by the auto_now_add=True
attribute in the model. Consider whether this manual setting is needed or if it could lead to unintended behavior.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
user = models.ForeignKey( | ||
to=settings.AUTH_USER_MODEL, |
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.
Read documentation. Import settings
form django.conf
user = User.objects.create_user( | ||
username=username, | ||
password=password | ||
) | ||
if email: | ||
user.email = email | ||
if first_name: | ||
user.first_name = first_name | ||
if last_name: | ||
user.last_name = last_name | ||
user.save() | ||
return 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.
create_user
will validate empty fields, so you don't need to check if they are not None
.
user = User.objects.get(id=user_id) | ||
if username: |
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.
Use get_user
method here
@@ -25,4 +25,8 @@ | |||
|
|||
INSTALLED_APPS = [ | |||
"db", |
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.
db
should be last in this list
No description provided.