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 Macgregor wrote:
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,

    Is there any way to set the password of an existing user to and
    unusable value like none?

    I tried user.set_unusable_password() and subsequently user.save()
    but this did not work.

    Other than using this method is there a way to set the password to
    None or such like so that the user.has_usable_password() method will
    return False instead of True?

    Many Thanks,
    nav

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

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

Reply via email to