Thanks Russ for your explanation.
You are right I did not understand Andrew correctly. Forgive me for my
ignorance. :-)
I did not know there were so many ways to do the same thing.
Thank you very much for the example.
nav
On Sunday 23 September 2012 05:16 AM, Russell Keith-Magee wrote:
On
On Sat, Sep 22, 2012 at 3:18 PM, Nandakumar Chandrasekhar
wrote:
> Thanks Andrew but I have a requirement where I have to programmatically set
> it to an unusable password based on a particular condition.
Andrew's given you the answer - it's just not clear that you've
understood what the answer i
This isn't that rare - it is a common UX requirement.
Set the value to something that cannot hash to any input. Depending on your
setup, '0' could work, or any other nonsense value. If you have a strict DB
schema, IIRC, there are some magic values that SHA will never generate, but I'd
have to
Thanks Andrew but I have a requirement where I have to programmatically
set it to an unusable password based on a particular condition.
I know this is a rare requirement but in the context of the application
I am building it makes sense. :-)
nav
On Friday 21 September 2012 12:22 PM, Andrew M
AFAIK you can set it to ! in the admin interface. Don't use the change
password form, just enter ! into the password field on the Auth User table.
I believe this will cause has_usable_password() to return False.
Cheers, Andrew.
On Friday, September 21, 2012 2:16:22 PM UTC+8, nav wrote:
>
> Hi,
Thanks Paul,
I have tried this on the Django shell and works for me as well.
Since I am using some third party software to do social site
authentication I might have made a mistake and not accessed the actual
django user object.
Thanks once again.
nav
On Friday 21 September 2012 03:17 PM,
Works for me...
>>> from django.contrib.auth.models import User
>>> user = User.objects.latest('id')
>>> user.has_usable_password()
True
>>> user.set_unusable_password()
>>> user.has_usable_password()
False
On Thu, 2012-09-20 at 23:16 -0700, nav wrote:
> Hi,
>
> Is there any way to set the pass
7 matches
Mail list logo