#32553: Allow UserAttributeSimilarityValidator to validate against fields of
related models
------------------------------+--------------------------------------
     Reporter:  Meiyer        |                    Owner:  nobody
         Type:  New feature   |                   Status:  closed
    Component:  contrib.auth  |                  Version:  dev
     Severity:  Normal        |               Resolution:  wontfix
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by Meiyer):

 1. I do not see the complexity being mentioned in Mariusz’s feedback. The
 change required for the validator itself is customisable logic to obtain
 the attribute’s `value` (and possibly `verbose_name`) by substitution of
 the line which performs `getattr` with a call to
 `self.get_user_attribute`. This pluggable helper could be defined per
 default as

 {{{#!python
   def get_user_attribute(self, user, attribute_name):
       return getattr(user, attribute_name, None)
 }}}

 2. It is not possible to add properties to the built-in `User` model, and
 switching the `User` model for code which runs in production multiple
 years already with thousands of users is an endeavour too risky.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32553#comment:3>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/067.8ea679baa7280f82be13e4b1f83cb137%40djangoproject.com.

Reply via email to