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

Develop #934

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

Develop #934

wants to merge 4 commits into from

Conversation

MatvijSafonov
Copy link

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! 😊 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:

  1. Use of User instead of get_user_model(): It's important to use get_user_model() to ensure flexibility and compatibility with custom user models. Please update your code in services/user.py to reflect this best practice.

  2. Repeated save() Calls: In the create_user function, try to minimize the number of save() calls to improve efficiency and adhere to best practices.

  3. Missing Transaction Decorator: Ensure that the create_movie function in services/movie.py is wrapped in a transaction using the @transaction.atomic decorator to maintain data integrity.

  4. Missing Migrations: Please include migration files in your pull request to ensure that tests can pass and the database schema is up-to-date.

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

Comment on lines +23 to +25
if date:
order.created_at = date
order.save()

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.

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.

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.

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.

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.

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.

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.

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.

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.

Comment on lines +61 to +62
user = models.ForeignKey(
to=settings.AUTH_USER_MODEL,

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

Link

Comment on lines +15 to +26
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

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.

Comment on lines +45 to +46
user = User.objects.get(id=user_id)
if username:

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

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

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.

4 participants