Re: [Django] #29647: "Please correct the error below." when saving edit model form with inline formset and space at the end of primary key value

2018-08-09 Thread Django
#29647: "Please correct the error below." when saving edit model form with 
inline
formset and space at the end of primary key value
---+--
 Reporter:  Alex Uralov|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  2.1
 Severity:  Normal |   Resolution:  invalid
 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 Alex Uralov):

 Thank you for the advice!

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.88ef30f53fb6c414cdd43553ca1e1fd1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29647: "Please correct the error below." when saving edit model form with inline formset and space at the end of primary key value

2018-08-08 Thread Django
#29647: "Please correct the error below." when saving edit model form with 
inline
formset and space at the end of primary key value
---+--
 Reporter:  Alex Uralov|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  2.1
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Tim Graham):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Yes, I can reproduce with those steps. Thanks. Inspecting the errors
 manually, I see `[{'attribute': ['The inline value did not match the
 parent instance.']}]`. I think the root cause is that the trailing space
 is stripped in the parent instance but not for the child instance. I don't
 think this is a bug in Django but it could be considered a duplicate of
 #2259 in that the primary key probably shouldn't be editable in the first
 place. I think you could fix that using `ModelAdmin.readonly_fields`.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.9f4cc2a4a5dd08892c1c730489667f3a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29647: "Please correct the error below." when saving edit model form with inline formset and space at the end of primary key value

2018-08-08 Thread Django
#29647: "Please correct the error below." when saving edit model form with 
inline
formset and space at the end of primary key value
---+--
 Reporter:  Alex Uralov|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  2.1
 Severity:  Normal |   Resolution:
 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 Alex Uralov):

 Replying to [comment:1 Tim Graham]:
 > I can't reproduce this given the models and admin you provided. Which
 version of Django are you using? Starting
 [https://docs.djangoproject.com/en/dev/releases/1.9/#miscellaneous in
 Django 1.9]:
 >  CharField now strips input of leading and trailing whitespace by
 default. This can be disabled by setting the new strip argument to False.
 >
 > The behavior I see when editing an `Attribute` whose `name` contains a
 trailing space is that a new instance is created because primary keys
 aren't editable as described in #2259.

 I use Django==2.0.8. Could you reproduce this by steps:
 1) Create a new Attribute item without spaces. For example 'test'
 2) Change the name (primary key) of the attribute via db query. UPDATE
 "public"."MODULE_attribute" SET "name" = 'test ' WHERE "name" = 'test'
 3) Open Django admin panel and try to append any AttributeValue to 'test '
 attribute.
 4) I get the error message "Please correct the error below."

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.12e3e630c1bd07b1ec6dc98498028ebd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29647: "Please correct the error below." when saving edit model form with inline formset and space at the end of primary key value

2018-08-07 Thread Django
#29647: "Please correct the error below." when saving edit model form with 
inline
formset and space at the end of primary key value
---+--
 Reporter:  uralov |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  2.1
 Severity:  Normal |   Resolution:
 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 Tim Graham):

 I can't reproduce this given the models and admin you provided. Which
 version of Django are you using? Starting
 [https://docs.djangoproject.com/en/dev/releases/1.9/#miscellaneous in
 Django 1.9]:
  CharField now strips input of leading and trailing whitespace by default.
 This can be disabled by setting the new strip argument to False.

 The behavior I see when editing an `Attribute` whose `name` contains a
 trailing space is that a new instance is created because primary keys
 aren't editable as described in #2259.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5f4d0bec27d339266c2c2ca6315ae274%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29647: "Please correct the error below." when saving edit model form with inline formset and space at the end of primary key value

2018-08-07 Thread Django
#29647: "Please correct the error below." when saving edit model form with 
inline
formset and space at the end of primary key value
---+--
 Reporter:  uralov |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  2.1
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by uralov):

 * Attachment "admin_error.png" added.


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.b508fbc5713825bd44e2c3c28cf647e4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29647: "Please correct the error below." when saving edit model form with inline formset and space at the end of primary key value

2018-08-07 Thread Django
#29647: "Please correct the error below." when saving edit model form with 
inline
formset and space at the end of primary key value
---+--
 Reporter:  uralov |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  2.1
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by uralov):

 * Attachment "admin.py" added.

 Models and admin classes

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.eecd46f4177effd4ff210e9148dda8b2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.