summaryrefslogtreecommitdiff
path: root/src/mailman/model/docs
diff options
context:
space:
mode:
authorBarry Warsaw2015-03-28 16:14:10 -0400
committerBarry Warsaw2015-03-28 16:14:10 -0400
commitdb5311200674432669787ef05d019536d3011c4e (patch)
tree31ff2401763890d49ee0a2c94ec684709fc926dc /src/mailman/model/docs
parentf3d34e989155cbe82e0c2db3fc9659ff73001dbe (diff)
parenteef0c0a53ed3068a1c8def64f51479673d7c08a7 (diff)
downloadmailman-db5311200674432669787ef05d019536d3011c4e.tar.gz
mailman-db5311200674432669787ef05d019536d3011c4e.tar.zst
mailman-db5311200674432669787ef05d019536d3011c4e.zip
trunk merge
Diffstat (limited to 'src/mailman/model/docs')
-rw-r--r--src/mailman/model/docs/usermanager.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mailman/model/docs/usermanager.rst b/src/mailman/model/docs/usermanager.rst
index ba328b54b..8e40b621e 100644
--- a/src/mailman/model/docs/usermanager.rst
+++ b/src/mailman/model/docs/usermanager.rst
@@ -179,3 +179,25 @@ There are now four members in the system. Sort them by address then role.
test.example.com bperson@example.com MemberRole.owner
test.example.com eperson@example.com MemberRole.member
test.example.com fperson@example.com MemberRole.member
+
+
+Creating a new user
+===================
+
+A common situation (especially during the subscription life cycle) is to
+create a user linked to an address, with a preferred address. Say for
+example, we are asked to subscribe a new address we have never seen before.
+
+ >>> cris = user_manager.make_user('cris@example.com', 'Cris Person')
+
+Since we've never seen ``cris@example.com`` before, this call creates a new
+user with the given email and display name.
+
+ >>> cris
+ <User "Cris Person" (5) at ...>
+
+The user has a single unverified address object.
+
+ >>> for address in cris.addresses:
+ ... print(repr(address))
+ <Address: Cris Person <cris@example.com> [not verified] at ...>