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

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

Conversation

A-n-a-s-t-a-s-i-i-a
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 meets most of the task requirements, there are a few critical issues that need to be addressed before we can approve the pull request:

  1. Image Field in Movie Model: Ensure that the ImageField is correctly implemented in the Movie model. It should not be available on the POST api/cinema/movies/ endpoint but should be visible on the Movie list and detail pages, as well as on the Movie session list and detail pages.

  2. create_custom_path Function: Please verify that the create_custom_path function is defined in cinema.models and formats the image path as f"{slugify(movie.title)}-{uuid}{ext}", as specified in the task description.

  3. Code Style and Imports: Make sure there is a blank line at the end of all files and check that imports are grouped using parentheses where necessary.

These changes are important to ensure the functionality and requirements of the task are fully met. Once these issues are resolved, we can proceed with the approval. Keep up the great work, and don't hesitate to reach out if you need any help! 🚀

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

model_name="movie",
name="image",
field=models.ImageField(
null=True, upload_to=cinema.models.create_custom_path

Choose a reason for hiding this comment

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

Ensure that the create_custom_path function is defined in cinema.models and correctly formats the image path as f"{slugify(movie.title)}-{uuid}{ext}", as required by the task description.

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 functionality! 🎉 While the Pull Request is approved to help you move forward with your learning, there are a few important issues to address:

  1. ImageField in Movie Model: Ensure that the image upload is only available through the /upload-image/ endpoint and not through the POST api/cinema/movies/ endpoint.

  2. create_custom_path Function: The create_custom_path function should be defined in cinema.models and format the image path as f"{slugify(movie.title)}-{uuid}{ext}". Make sure to generate a UUID using uuid.uuid4() and convert it to a string before using it in the filename.

  3. Code Style and Imports: Ensure there is a blank line at the end of all files and check that imports are grouped using parentheses where necessary for clean and readable code.

  4. Unrelated Files: Files related to user management should be reviewed separately if they are not part of the current task requirements.

Please review these comments to improve your code. Addressing these issues will enhance the functionality and maintainability of your project. Keep up the good work and continue learning from these experiences! 🚀

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

model_name="movie",
name="image",
field=models.ImageField(
null=True, upload_to=cinema.models.create_custom_path

Choose a reason for hiding this comment

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

Ensure that the create_custom_path function is defined in cinema.models and correctly formats the image path as specified in the task description.

Comment on lines +45 to +46
filename = (f"{slugify(instance.title)}-{uuid}{ext}"
+ pathlib.Path(filename).suffix)

Choose a reason for hiding this comment

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

There is a mistake in the create_custom_path function. The uuid variable is not defined before being used in the filename formatting. You should generate a UUID using uuid.uuid4() and convert it to a string before using it in the filename.

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.

2 participants