Hi,
I have a unique constraint set for 1 of my fields in the model.
class Meta:
constraints = [
models.UniqueConstraint(
Lower('name'),
name='uniqueName'
),
]
When I run this locally and try to add a new item with a duplicated name within the admin I get a nice validation error saying the name already exists, but when I push this change to production, instead of getting the nice validation error it just returns server 500 error.
Is this expected? I was hoping that it would work the same way as running locally.
Is there a way to prevent this from happening?
Thanks