#35103: UniqueConstraint message does not use violation_error_message
-------------------------------------+-------------------------------------
     Reporter:  Gerben Morsink       |                    Owner:  Gerben
         Type:                       |  Morsink
  Cleanup/optimization               |                   Status:  closed
    Component:  Database layer       |                  Version:  5.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  UniqueConstraint,    |             Triage Stage:  Ready for
  violation_error_message            |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Brendan):

 I think this is still perhaps not working as intended, in particular when
 using expressions. We can see with the simple case:

 {{{
 from django.db import models

 class MyModel(models.Model)
     name = models.CharField()

     class Meta:
         constraints = (
             models.UniqueConstraint(
                 Lower("name"),
                 name="unique_supplier_name",
                 violation_error_message="test"
             ),
         )
 }}}

 If for some reason it should be obvious and expected that
 `violation_error_message` should not apply when using expressions, I think
 we could perhaps clean up the docs to clarify this (and maybe why).
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35103#comment:20>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019906d9314e-32aff1fb-4819-4bea-aff8-e3f7c193ec23-000000%40eu-central-1.amazonses.com.

Reply via email to