mirror of
https://github.com/ae-utbm/sith.git
synced 2025-06-22 03:05:18 +00:00
Ensure quickupload image field uniqueness
This commit is contained in:
parent
0f961c71e0
commit
6128b6564c
@ -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
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -29,6 +29,7 @@ class Migration(migrations.Migration):
|
|||||||
"image",
|
"image",
|
||||||
models.ImageField(
|
models.ImageField(
|
||||||
height_field="height",
|
height_field="height",
|
||||||
|
unique=True,
|
||||||
upload_to="upload/%Y/%m/%d",
|
upload_to="upload/%Y/%m/%d",
|
||||||
width_field="width",
|
width_field="width",
|
||||||
),
|
),
|
||||||
|
@ -1115,7 +1115,10 @@ class QuickUploadImage(models.Model):
|
|||||||
uuid = models.UUIDField(unique=True, db_index=True)
|
uuid = models.UUIDField(unique=True, db_index=True)
|
||||||
name = models.CharField(max_length=IMAGE_NAME_SIZE, blank=False)
|
name = models.CharField(max_length=IMAGE_NAME_SIZE, blank=False)
|
||||||
image = models.ImageField(
|
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(
|
uploader = models.ForeignKey(
|
||||||
"User",
|
"User",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user