Add API endpoint to upload images

This commit is contained in:
2025-02-26 23:15:26 +01:00
parent 60fd72917d
commit 10367d21ab
3 changed files with 79 additions and 2 deletions

View File

@ -764,6 +764,10 @@ Welcome to the wiki page!
]
)
# Upload folder
SithFile.objects.create(name="upload", owner=root)
(settings.MEDIA_ROOT / "upload").mkdir(parents=True, exist_ok=True)
def _create_profile_pict(self, user: User):
path = self.SAS_FIXTURE_PATH / "Family" / f"{user.username}.jpg"
file = resize_image(Image.open(path), 400, "WEBP")