Adds avatar upload of a custom avatar. Fixes #38. #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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...