Re: [Django] #6362: Remove blank spaces with strip when validating the data

12 views
Skip to first unread message

Django

unread,
May 20, 2011, 9:01:18 AM5/20/11
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New | Status: new
feature | Component: Forms
Milestone: | Severity: Normal
Version: SVN | Keywords: blank space strip
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 0
decision needed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 1 |
-------------------------------------+-------------------------------------
Changes (by boxed):

* easy: => 0


Comment:

Spaces in various fields in the database screw up sorting too, which gets
reported as bugs because the spaces are of course not even shown by HTML.

It's also very hard to fix after the fact. Cron jobs that run strips on
all character fields on all your models? No thanks :P

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:38>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 20, 2011, 9:01:35 AM5/20/11
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New | Status: new
feature | Component: Forms
Milestone: | Severity: Normal
Version: SVN | Keywords: blank space strip
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 0
decision needed | Easy pickings: 1
Needs documentation: 0 |
Patch needs improvement: 1 |
-------------------------------------+-------------------------------------
Changes (by boxed):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:39>

Django

unread,
May 20, 2011, 12:06:40 PM5/20/11
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New | Status: new
feature | Component: Forms
Milestone: | Severity: Normal
Version: SVN | Keywords: blank space strip
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 0
decision needed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 1 |
-------------------------------------+-------------------------------------
Changes (by ramiro):

* easy: 1 => 0


Comment:

Replying to [comment:39 boxed]:

''Easy picking'' is a recently added nullable boolean-like flag for
tickets in our Trac instance that is reset to false with the first update
to the ticket after it got added. That is the reason it changes even when
you hadn't deactivated it explicitly. There is no need to set it back to
on.

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:40>

Django

unread,
Jun 27, 2011, 11:11:00 AM6/27/11
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New | Status: new
feature | Component: Forms
Milestone: | Severity: Normal
Version: SVN | Keywords: blank space strip
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 0
decision needed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by alekam):

* cc: alex@… (added)
* ui_ux: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:41>

Django

unread,
Jun 27, 2011, 7:04:29 PM6/27/11
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New | Status: new
feature | Component: Forms
Milestone: | Severity: Normal
Version: SVN | Keywords: blank space strip
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 0
decision needed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by t.zander@…):

* cc: t.zander@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:42>

Django

unread,
Jul 4, 2011, 10:51:48 AM7/4/11
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New | Status: closed
feature | Component: Forms
Milestone: | Severity: Normal
Version: SVN | Keywords: blank space strip
Resolution: wontfix | Has patch: 1
Triage Stage: Design | Needs tests: 0
decision needed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by jacob):

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


Comment:

Silently discarding user input -- whether it's spaces or not -- isn't
something a framework ought to do. There are enough ways to do this in
user code, but if Django strips spaces there aren't any way to get them
back, so it's gotta stay this way.

I'd be slightly in favor of a normalization callback for fields (as
suggested above), or ''maybe'' some sort of "strip spaces" flag (but only
if done is a reasonable manner. If someone has a good proposal (hopefully
with a patch) here feel free to open a new ticket for it.

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:43>

Django

unread,
Jan 24, 2013, 12:20:21 PM1/24/13
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix
Keywords: blank space strip | Triage Stage: Design
Has patch: 1 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by intgr):

* cc: marti@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:44>

Django

unread,
Sep 18, 2013, 12:22:30 AM9/18/13
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix
Keywords: blank space strip | Triage Stage: Design
Has patch: 1 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by anonymous):

It is really error prone to do the stripping manually. This should be
reconsidered.

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:45>

Django

unread,
Jun 24, 2014, 4:40:52 PM6/24/14
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix
Keywords: blank space strip | Triage Stage: Design
Has patch: 1 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by carbonXT):

FWIW, I agree with @jacob's decision that by default the framework
shouldn't be mucking with user input. However, since removing
leading/trailing whitespace is the desired behavior for I believe form
I've ever written... a 'strip spaces' flag would be helpful.

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:46>

Django

unread,
Jul 3, 2014, 5:13:44 PM7/3/14
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix
Keywords: blank space strip | Triage Stage: Design
Has patch: 1 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by jdufresne):

+1. I would really appreciate if this feature could be reconsidered.
Whether it is on by default or not, I don't care. Users are bypassing form
validation by entering spaces in required fields. This seems to throw away
the entire point.

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:47>

Django

unread,
Feb 4, 2015, 10:01:40 AM2/4/15
to django-...@googlegroups.com
#6362: Remove blank spaces with strip when validating the data
-------------------------------------+-------------------------------------
Reporter: marinho | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix
Keywords: blank space strip | Triage Stage: Design
| decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by tomchristie):

Link to latest thread on the discussion group regarding this...

https://groups.google.com/d/msg/django-developers/D1GBj9VB9sk/gDm5PFHMKSUJ

--
Ticket URL: <https://code.djangoproject.com/ticket/6362#comment:48>

Reply all
Reply to author
Forward
0 new messages