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

Adds avatar upload of a custom avatar. Fixes #38. #48

Merged
merged 6 commits into from
Oct 23, 2021

Conversation

quimnuss
Copy link
Collaborator

Adds an endpoint ("/users/u/{userID}/avatar") to upload a file and save it to disk using the avatar id of the user.
It checks for file but it doesn't check its sanity (this requires installling Pillow module).

Tests are conditional to having Pillow module installed to create or load an image.

I think this structure will be enough but there's an integration bug to be solved: atm I use {user_id}_avatar.jpeg as filename, but the user has an avatar filename parameter, do we want to use that as filename ? I think it's superfluous but if we might have different directories or whatever might be useful.

Atm it stores the image file to disk, but we could use a MinIO or something to be more organized.

I've discarded the option of storing the image in the database, it wasn't pretty imo...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants