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

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

Solution #35

wants to merge 1 commit into from

Conversation

u123dev
Copy link

@u123dev u123dev commented Feb 4, 2025

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.

Great job on implementing the task requirements! 🎉 Your code meets the core functionality needed for user account and movie management. While there are a few areas for improvement, such as enhancing error messages for clarity and ensuring password security, these are minor and don't impact the overall functionality. Keep up the good work, and consider the feedback for future enhancements! 😊

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

detail=f"A user with this email {user_data.email} already exists."
)

group = db.query(UserGroupModel).filter(UserGroupModel.name == UserGroupEnum.USER).first()

Choose a reason for hiding this comment

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

Ensure that the UserGroupEnum.USER is correctly defined and accessible. If the enum value is not found, this line will raise an error. Consider adding error handling or validation to ensure the group exists.

db.rollback()
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail="An error occurred during user activation."

Choose a reason for hiding this comment

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

The error detail message here is incorrect. It should mention an error during password reset request instead of user activation. Consider updating the error message for clarity.

if is_bad_token:
db.commit()
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid email or token.")
user.password = user_data.password

Choose a reason for hiding this comment

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

Ensure that the user_data.password is hashed before being stored in the database. Storing plain text passwords is a security risk. Consider using the hash_password function to hash the password before assignment.

@@ -208,7 +208,7 @@ def create_movie(
return MovieDetailSchema.model_validate(movie)
except IntegrityError:
db.rollback()
raise HTTPException(status_code=400, detail=f"Invalid input data.")
raise HTTPException(status_code=400, detail="Invalid input data.")

Choose a reason for hiding this comment

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

The error message here should be more specific to the context of movie creation. Consider updating the detail message to reflect that the error occurred during movie creation.

@@ -394,6 +394,6 @@ def update_movie(
db.refresh(movie)
except IntegrityError:
db.rollback()
raise HTTPException(status_code=400, detail=f"Invalid input data.")
raise HTTPException(status_code=400, detail="Invalid input data.")

Choose a reason for hiding this comment

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

The error message here should be more specific to the context of movie updating. Consider updating the detail message to reflect that the error occurred during movie updating.

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