Re: password is None in check_password

2010-10-08 Thread Laurent Luce
I just want to summarize the password handling changes before and
after this patch.

before:
- create_user() with empty password or None -> password set to '!'
unusable
- set_password() accepts everything
- has_usable_password() returning False for password equal to '!'

after:
- create_user() with password None -> password set to '!' unusable
- set_password() with None -> password set to '!' unusable
- has_usable_password() returning False for password equal to '!' or
None

Laurent

On Oct 8, 4:47 pm, Laurent Luce <laurentluc...@yahoo.com> wrote:
> Thanks for your feedback. I attached a new patch with the following
> changes:
>
> * allow empty string in set_password()
> * has_usable_password() returns false if password is '!' or None
> * add unit test set_password(None)
> * add verbosity option to createsuperuser command + unit test
> * output msg to stdout in createsuperuser command + update unit tests
>
> Let me know if the patch still needs improvement.
>
> Laurent Luce
>
> On Oct 7, 11:17 pm, Russell Keith-Magee <russ...@keith-magee.com>
> wrote:
>
> > On Fri, Oct 8, 2010 at 11:28 AM, Laurent Luce <laurentluc...@yahoo.com> 
> > wrote:
> > > I noticed that create_user() is currently setting password to unusable
> > > if it is None or empty. However, set_password() is accepting an empty
> > > password. I decided to follow the first rule in the patch I submitted
> > > but I am kind of confused now. Can someone indicate what we should
> > > accept as a password?
>
> > An empty string isn't a *good* password, but then neither is a single
> > character or a dictionary word, and we don't reject those. Policy
> > decisions like this aren't the domain of a web framework.
>
> > I'm sure there are also people using an empty password as the "I don't
> > actually want security" password. Plus, there's a history in the free
> > software community of using empty passwords as a protest [1] :-)
>
> > We can use None to mark an unusable password. Absent of a good
> > technical reason, I don't see why we should reject empty string.
>
> > As for the remainder of the patch on #14354 -- on the whole, it looks
> > good. I've put some review comments on the ticket.
>
> > [1]http://en.wikipedia.org/wiki/Richard_Stallman#Early_years
>
> > Yours,
> > Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



password is None in check_password

2010-10-07 Thread Laurent Luce
Hello,

Regarding the issue about password is None in check_password (http://
code.djangoproject.com/ticket/14354). I attached a patch with the
following changes:

- in set_password(), check for raw_password and if None or empty, call
set_unusable_password(), otherwise same as before

- in has_usable_password(), return True only if password is not None,
not empty, or '!'

- because of the 2 changes above, we can simplify a bit create_user()
by just calling set_password() for all cases. No need to test password
inside this function anymore.

- basic.py tests are now unittests and not doctests

I assumed that has_usable_password() will be called directly by the
user code so I didn't modify check_password().

Please let me know if my changes match what is expected.

Laurent
http://www.laurentluce.com
http://www.gourmious.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Site app should be able to make absolute URLs #10944

2010-10-06 Thread Laurent Luce
I added a new patch with the following changes:

- added get_url() to RequestSite
- added support for protocol to get_url() and template tag site_url.
You can pass a protocol like 'https', default is 'http'.
- updated docs.

I agree with SmileyChris that the template tag site_url doesn't
provide enough value. Can people reply to this email with potential
improvements to make this new tag more useful. Let's start a
discussion basically.

Laurent


On Oct 5, 2:52 pm, Gabriel Hurley <gab...@gmail.com> wrote:
> I added some feedback on the ticket. Looks like a good start!
>
>     - Gabriel
>
> On Oct 4, 2:12 pm, Laurent Luce <laurentluc...@yahoo.com> wrote:
>
> > Hello,
>
> > I added a patch to this ticket http://code.djangoproject.com/
> > ticket/10944">#10944
>
> > - add method get_url to Site model to return an absolute url based on
> > a relative path passed as an argument.
> > - add site_url template tag doing the same
>
> > I am not sure about the method and template tag names. Better naming
> > is welcome.
>
> > Can someone review the patch?
>
> > I will work on the documentation changes when I get more feedback.
>
> > Laurent Luce

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



update man django-admin.1 to include missing commands

2010-10-05 Thread Laurent Luce
Hello,

I added a patch to this ticket: http://code.djangoproject.com/ticket/14391

This is to make django-admin.1 in sync with django-admin.py

Laurent Luce

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: reset and sqlreset - PendingDeprecationWarning

2010-10-04 Thread Laurent Luce
Thanks for those details. In case someone is using those commands and
is kind of happy with them, what would be the alternative? sql_reset =
sql_delete + sql_add but those commands are not exposed so I am
wondering.

Laurent

On Oct 4, 4:54 pm, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Tue, Oct 5, 2010 at 2:55 AM, Laurent Luce <laurentluc...@yahoo.com> wrote:
> > Hello,
>
> > I am looking at ticket #14268 on reset and sqlreset management
> > commands should raise PendingDeprecationWarning for 1.3.
>
> > I added some code to django/core/management/commands/reset.py and
> > django/core/management/sql.py to raise the appropriate warning.
>
> > What message should I displayed ? I have the following right now:
> > "This command is pending deprecation." I know it is not really
> > insightful. The real reason is that those commands don't work well but
> > I don't think we want to have that as the message.
>
> Something short and pithy is all you need. There are a couple of
> existing PendingDeprecationWarnings in Django's code already; use
> those as a guide for appropriate style.
>
> Don't get too concerned about getting the text completely perfect,
> though; a core committer will probably give the text a polish before
> they commit.
>
> > I guess I also need to update docs/releases/1.3.txt with an
> > explanation on why deprecation is pending.
>
> Correct. Again, don't get too concerned about the exact text --
> documentation is almost *always* polished before committing.
>
> > Finally, do I need to update the following files with the warning
> > information.
> > docs/ref/django-admin.txt
> > docs/man/django-admin.1
>
> Yes. In ref/django-admin.txt, you can use a Sphinx annotation to
> declare the deprecated feature:
>
> .. deprecated:: 1.3
>
> There are a couple of other uses of this in the docs, so search around
> for examples of usage. You might also want to do a quick audit of
> django-admin.1 to check that we actually have all the builtin admin
> commands... I have a sneaking suspicion there might be a couple
> missing.
>
> Yours,
> Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Site app should be able to make absolute URLs #10944

2010-10-04 Thread Laurent Luce
Hello,

I added a patch to this ticket http://code.djangoproject.com/
ticket/10944">#10944

- add method get_url to Site model to return an absolute url based on
a relative path passed as an argument.
- add site_url template tag doing the same

I am not sure about the method and template tag names. Better naming
is welcome.

Can someone review the patch?

I will work on the documentation changes when I get more feedback.

Laurent Luce

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



reset and sqlreset - PendingDeprecationWarning

2010-10-04 Thread Laurent Luce
Hello,

I am looking at ticket #14268 on reset and sqlreset management
commands should raise PendingDeprecationWarning for 1.3.

I added some code to django/core/management/commands/reset.py and
django/core/management/sql.py to raise the appropriate warning.

What message should I displayed ? I have the following right now:
"This command is pending deprecation." I know it is not really
insightful. The real reason is that those commands don't work well but
I don't think we want to have that as the message.

I guess I also need to update docs/releases/1.3.txt with an
explanation on why deprecation is pending.

Finally, do I need to update the following files with the warning
information.
docs/ref/django-admin.txt
docs/man/django-admin.1

Laurent Luce

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Contributing more

2010-10-04 Thread Laurent Luce
Thank you all for the great insights.

On Oct 3, 8:07 pm, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Mon, Oct 4, 2010 at 10:11 AM, Laurent Luce <laurentluc...@yahoo.com> wrote:
> > Hello,
>
> > I added the localflavor for Belgium as my first contribution. I would
> > like to contribute more code wise. I looked at the tickets with
> > milestone 1.3 and with no patch. It is hard to know what is critical
> > and where help is the most needed.
>
> > Can someone tell me what tickets require immediate help and are not
> > too complicated for a new contributor. I don't mind spending 2-3 days
> > before Oct 18th. I have been using Django for 2 years and I am quite
> > familiar with the basics like views, models, templates and forms.
>
> > Please let me know.
>
> First of all -- thanks for offering to help out!
>
> Unfortunately, there is no simple answer to the "what is critical" question.
>
> We try to ship Django releases that don't contain any bugs that cause
> unexpected data-loss or major system crashes at runtime -- they're the
> only type of bug that we genuinely consider critical, and we postpone
> releases if anyone reports them. So, there *shouldn't* be any of those
> bugs in our system.
>
> Beyond that, it's difficult to point you at a list of "important
> tickets". Anything that is currently open is a candidate for being
> closed; the tickets that get closed are the ones that people actively
> pursue to completion.
>
> So - what should you do? Well, here's the general list of tasks that
> need attention:
>
>  * Any ticket in the unreviewed state [1] needs to be verified. See if
> you can reproduce the problem described. If you can, move the ticket
> to Accepted. If you can't, close the ticket. If you think there is a
> major design issue in question, move to Design Decision Needed. Ask
> around on IRC if you need guidance on how to treat a given ticket. If,
> in the process of verifying the problem, you can construct a test case
> that is integrated with Django's own test suite, you get bonus points;
> upload a patch containing the test when you mark the ticket accepted.
>
>  * Any ticket in the accepted state that doesn't already have a patch
> [2], needs a patch. Try your hand at fixing the problem.
>
>  * Any ticket in the accepted state that has a patch, but isn't marked
> "needs docs", "needs tests" or "needs improvement" [3] probably needs
> a review by someone. Review the patch; if it seems like the right fix
> for the problem, and it has tests and docs (as required), move it to
> RFC.
>
>  * Any ticket in the accepted state that *is* marked "needs docs" [4],
> "needs tests" [5] or "needs improvement" [6] indicates that there is
> work to be done. Fix the problem, drop the flag.
>
> [1]http://code.djangoproject.com/query?status=new=assigned...
>
> [2]http://code.djangoproject.com/query?status=new=assigned...
>
> [3]http://code.djangoproject.com/query?status=new=assigned...
>
> [4]http://code.djangoproject.com/query?status=new=assigned...
>
> [5]http://code.djangoproject.com/query?status=new=assigned...
>
> [6]http://code.djangoproject.com/query?status=new=assigned...
>
> These queries reveal some pretty long ticket lists, which still leaves
> the issue of which one to pick.
>
> [2]-[6] can be filtered by milestone, which will reduce the ticket
> count a little; the milestone isn't a guaranteed marker that an issue
> is important, but it usually means that *someone* thinks it is
> important.
>
> Any ticket with lots of discussion, or a long CC list probably
> indicates that there are lot of people interested. This is also a
> reasonable indication that a ticket is worth looking into.
>
> Other than that -- work on whatever interests you. Pick a component
> where you feel comfortable, and use that component to filter the Trac
> queries I gave.
>
> As for the October 18th deadline -- that's a deadline for major
> feature inclusion. For 1.3, this is looking like #12012, #12991, and
> maybe #6735 and #12323. If you want to help out with these tickets,
> test the candidate patches, and check the mailing lists for any recent
> discussions about issues still needing resolution.
>
> After that date, focus will move to smaller features and bug fixes
> until the end of November. Past that date, we will move to focussing
> on purely bug fixes until the release early in the new year.
>
> Yours,
> Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Contributing more

2010-10-03 Thread Laurent Luce
Hello,

I added the localflavor for Belgium as my first contribution. I would
like to contribute more code wise. I looked at the tickets with
milestone 1.3 and with no patch. It is hard to know what is critical
and where help is the most needed.

Can someone tell me what tickets require immediate help and are not
too complicated for a new contributor. I don't mind spending 2-3 days
before Oct 18th. I have been using Django for 2 years and I am quite
familiar with the basics like views, models, templates and forms.

Please let me know.

Laurent

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: be localflavor Belgium

2010-10-03 Thread Laurent Luce
Am I supposed to commit the patch? I don't think I have the privileges
to do that.

Laurent

On Sep 30, 5:35 pm, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Fri, Oct 1, 2010 at 6:15 AM, Laurent Luce <laurentluc...@yahoo.com> wrote:
> > I updated the be localflavor patch to use unit tests instead of
> > doctests as requested. Can you check if this is what you want. There
> > was no unit tests in regressiontests/forms/localflavor/ so I am not
> > 100% sure I did what is expected. I took a look at the ones in
> > regressiontests/forms as models.
>
> The patch looks good, so I've just bumped the ticket to ready for checkin.
>
> Thanks for the contribution!
>
> Yours,
> Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: be localflavor Belgium

2010-09-30 Thread Laurent Luce
I updated the be localflavor patch to use unit tests instead of
doctests as requested. Can you check if this is what you want. There
was no unit tests in regressiontests/forms/localflavor/ so I am not
100% sure I did what is expected. I took a look at the ones in
regressiontests/forms as models.

On Sep 29, 1:09 pm, Laurent Luce <laurentluc...@yahoo.com> wrote:
> I added a new patch to the ticket with the following changes:
> add support for 0, 04 phone number format. Wrap long
> lines.
>
> Laurent
>
> On Sep 29, 11:23 am, Gert Van Gool <gertvang...@gmail.com> wrote:
>
> > IMHO I would allow a non-spaced version. My typing my phone number as
> > 0498725202 should also work.
> > Second thing, wrap the long lines :)
>
> > Relevant ticket is #14349 (http://code.djangoproject.com/ticket/14349)
>
> > -- Gert
>
> > Mobile: +32 498725202
> > Twitter: @gvangool <http://twitter.com/gvangool>
> > Web:http://gert.selentic.net
>
> > On Wed, Sep 29, 2010 at 18:26, Laurent Luce <laurentluc...@yahoo.com> wrote:
> > > Hello,
>
> > > I created a patch to add support for Belgium to localflavor. I
> > > attached the patch to a ticket which is marked as accepted. The patch
> > > contains the forms fields, unit tests and the doc changes.
>
> > > What do I need to do next ? Wait for someone to review the patch and
> > > commit it ?
>
> > > Laurent
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django developers" group.
> > > To post to this group, send email to django-develop...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-developers+unsubscr...@googlegroups.com<django-developers%2bunsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-developers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: be localflavor Belgium

2010-09-29 Thread Laurent Luce
I added a new patch to the ticket with the following changes:
add support for 0, 04 phone number format. Wrap long
lines.

Laurent

On Sep 29, 11:23 am, Gert Van Gool <gertvang...@gmail.com> wrote:
> IMHO I would allow a non-spaced version. My typing my phone number as
> 0498725202 should also work.
> Second thing, wrap the long lines :)
>
> Relevant ticket is #14349 (http://code.djangoproject.com/ticket/14349)
>
> -- Gert
>
> Mobile: +32 498725202
> Twitter: @gvangool <http://twitter.com/gvangool>
> Web:http://gert.selentic.net
>
> On Wed, Sep 29, 2010 at 18:26, Laurent Luce <laurentluc...@yahoo.com> wrote:
> > Hello,
>
> > I created a patch to add support for Belgium to localflavor. I
> > attached the patch to a ticket which is marked as accepted. The patch
> > contains the forms fields, unit tests and the doc changes.
>
> > What do I need to do next ? Wait for someone to review the patch and
> > commit it ?
>
> > Laurent
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django developers" group.
> > To post to this group, send email to django-develop...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-developers+unsubscr...@googlegroups.com<django-developers%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-developers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



be localflavor Belgium

2010-09-29 Thread Laurent Luce
Hello,

I created a patch to add support for Belgium to localflavor. I
attached the patch to a ticket which is marked as accepted. The patch
contains the forms fields, unit tests and the doc changes.

What do I need to do next ? Wait for someone to review the patch and
commit it ?

Laurent

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.