fix: profiles: avatar upload file extension
This commit is contained in:
parent
daddf5bb25
commit
4323747e96
@ -8,8 +8,10 @@ from django.db.models import IntegerField
|
|||||||
|
|
||||||
from games.consumers import game_manager
|
from games.consumers import game_manager
|
||||||
|
|
||||||
|
from os.path import splitext
|
||||||
|
|
||||||
def upload_to(instance, filename: str):
|
def upload_to(instance, filename: str):
|
||||||
return f"./profiles/static/avatars/{instance.pk}.{filename.split('.')[1]}"
|
return f"./profiles/static/avatars/{instance.pk}{splitext(filename)[1]}"
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
class ProfileModel(models.Model):
|
class ProfileModel(models.Model):
|
||||||
|
Loading…
Reference in New Issue
Block a user