chore: limit svg uploads (#5462)
* fix: limit svg file uploads * chore: limit svg uploads
This commit is contained in:
parent
22a214795d
commit
0fbe4c4de2
2 changed files with 3 additions and 3 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
|
# Django import
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
# Django import
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.core.validators import FileExtensionValidator
|
||||||
|
|
||||||
# Module import
|
# Module import
|
||||||
from .base import BaseModel
|
from .base import BaseModel
|
||||||
|
|
@ -32,6 +32,7 @@ class FileAsset(BaseModel):
|
||||||
asset = models.FileField(
|
asset = models.FileField(
|
||||||
upload_to=get_upload_path,
|
upload_to=get_upload_path,
|
||||||
validators=[
|
validators=[
|
||||||
|
FileExtensionValidator(allowed_extensions=["jpg", "jpeg", "png"]),
|
||||||
file_size,
|
file_size,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -61,4 +61,3 @@ zxcvbn==4.4.28
|
||||||
pytz==2024.1
|
pytz==2024.1
|
||||||
# jwt
|
# jwt
|
||||||
PyJWT==2.8.0
|
PyJWT==2.8.0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue