image library
created using VS Codey Copilot Agent with Claude Sonnet 4
This commit is contained in:
parent
bdf06863d2
commit
52dbe89582
14 changed files with 1366 additions and 3 deletions
|
@ -4,10 +4,10 @@ from django.utils.text import slugify
|
|||
from django_prose_editor.fields import ProseEditorField
|
||||
|
||||
|
||||
def validate_image_size(value):
|
||||
def validate_image_size(value, mb=1):
|
||||
filesize = value.size
|
||||
if filesize > 1 * 1024 * 1024: # 1MB
|
||||
raise ValidationError("Maximum file size is 1MB")
|
||||
if filesize > mb * 1024 * 1024:
|
||||
raise ValidationError(f"Maximum file size is {mb} MB")
|
||||
|
||||
|
||||
class Currency(models.TextChoices):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue