#32210: Django Admin with Inlines not using UUIDField default value
----------------------------------+------------------------------------
     Reporter:  Joseph Metzinger  |                    Owner:  (none)
         Type:  Bug               |                   Status:  assigned
    Component:  Forms             |                  Version:  3.1
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by NeErAj KuMaR):

 The below code set id value **None** when formsets is_valid calling. so
 need to stop set id value None when that field is not model's pk as
 UUIDField.

 {{{
         if self.instance._state.adding:
             if kwargs.get("to_field") is not None:
                 to_field =
 self.instance._meta.get_field(kwargs["to_field"])
             else:
                 to_field = self.instance._meta.pk
             if to_field.has_default():
                 setattr(self.instance, to_field.attname, None)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32210#comment:5>
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/01070182c6f6a91e-e5266323-4d62-4b69-8bb1-5295dc74c1c3-000000%40eu-central-1.amazonses.com.

Reply via email to