chore: limit svg uploads (#5462)

* fix: limit svg file uploads

* chore: limit svg uploads
This commit is contained in:
Nikhil 2024-08-29 13:31:41 +05:30 committed by GitHub
parent 22a214795d
commit 0fbe4c4de2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -1,11 +1,11 @@
# Python imports
from uuid import uuid4
# Django import
from django.conf import settings
from django.core.exceptions import ValidationError
# Django import
from django.db import models
from django.core.validators import FileExtensionValidator
# Module import
from .base import BaseModel
@ -32,6 +32,7 @@ class FileAsset(BaseModel):
asset = models.FileField(
upload_to=get_upload_path,
validators=[
FileExtensionValidator(allowed_extensions=["jpg", "jpeg", "png"]),
file_size,
],
)

View file

@ -61,4 +61,3 @@ zxcvbn==4.4.28
pytz==2024.1
# jwt
PyJWT==2.8.0