diff --git a/core/migrations/0045_quickuploadimage.py b/core/migrations/0045_quickuploadimage.py index 30091c72..9464848c 100644 --- a/core/migrations/0045_quickuploadimage.py +++ b/core/migrations/0045_quickuploadimage.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.20 on 2025-04-10 08:14 +# Generated by Django 4.2.20 on 2025-04-10 09:34 import django.db.models.deletion from django.conf import settings @@ -29,6 +29,7 @@ class Migration(migrations.Migration): "image", models.ImageField( height_field="height", + unique=True, upload_to="upload/%Y/%m/%d", width_field="width", ), diff --git a/core/models.py b/core/models.py index 198a38b6..5c873c6c 100644 --- a/core/models.py +++ b/core/models.py @@ -1115,7 +1115,10 @@ class QuickUploadImage(models.Model): uuid = models.UUIDField(unique=True, db_index=True) name = models.CharField(max_length=IMAGE_NAME_SIZE, blank=False) image = models.ImageField( - upload_to="upload/%Y/%m/%d", width_field="width", height_field="height" + upload_to="upload/%Y/%m/%d", + width_field="width", + height_field="height", + unique=True, ) uploader = models.ForeignKey( "User",