Skip to content

Commit

Permalink
Fixed #19588 - Added create_superuser to UserManager docs.
Browse files Browse the repository at this point in the history
Thanks minddust for the report.
  • Loading branch information
timgraham committed Jan 10, 2013
1 parent cdad0b2 commit 4da5947
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/ref/contrib/auth.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ Manager methods
.. class:: models.UserManager .. class:: models.UserManager


The :class:`~django.contrib.auth.models.User` model has a custom manager The :class:`~django.contrib.auth.models.User` model has a custom manager
that has the following helper methods: that has the following helper methods (in addition to the methods provided
by :class:`~django.contrib.auth.models.BaseUserManager`):


.. method:: create_user(username, email=None, password=None) .. method:: create_user(username, email=None, password=None, **extra_fields)


Creates, saves and returns a :class:`~django.contrib.auth.models.User`. Creates, saves and returns a :class:`~django.contrib.auth.models.User`.


Expand All @@ -235,18 +236,17 @@ Manager methods
:meth:`~django.contrib.auth.models.User.set_unusable_password()` will :meth:`~django.contrib.auth.models.User.set_unusable_password()` will
be called. be called.


See :ref:`Creating users <topics-auth-creating-users>` for example usage. The ``extra_fields`` keyword arguments are passed through to the
:class:`~django.contrib.auth.models.User`'s ``__init__`` method to
allow setting arbitrary fields on a :ref:`custom User model
<auth-custom-user>`.


.. method:: make_random_password(length=10, allowed_chars='abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789') See :ref:`Creating users <topics-auth-creating-users>` for example usage.


Returns a random password with the given length and given string of .. method:: create_superuser(self, username, email, password, **extra_fields)
allowed characters. (Note that the default value of ``allowed_chars``
doesn't contain letters that can cause user confusion, including:


* ``i``, ``l``, ``I``, and ``1`` (lowercase letter i, lowercase Same as :meth:`create_user`, but sets :attr:`~models.User.is_staff` and
letter L, uppercase letter i, and the number one) :attr:`~models.User.is_superuser` to ``True``.
* ``o``, ``O``, and ``0`` (uppercase letter o, lowercase letter o,
and zero)




Anonymous users Anonymous users
Expand Down

0 comments on commit 4da5947

Please sign in to comment.