-
Notifications
You must be signed in to change notification settings - Fork 686
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 #729
base: master
Are you sure you want to change the base?
Solution #729
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.
Check comments
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.
Delete media folder from repo, it should be ignored(.gitignore
)
cinema/views.py
Outdated
if serializer.is_valid(): | ||
serializer.save() | ||
return Response(serializer.data, status=status.HTTP_200_OK) |
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 about raise_exceptions=True
, implement it here
cinema/models.py
Outdated
def image_custom_path(instance: "Movie", filename: str): | ||
filename = ( | ||
f"{slugify(instance.title)}-{uuid.uuid4()}" | ||
+ pathlib.Path(filename).suffix | ||
) | ||
return pathlib.Path("uploads/movies/") / pathlib.Path(filename) |
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 os.path.join
No description provided.