summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/user.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/interfaces/user.py')
-rw-r--r--src/mailman/interfaces/user.py27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/mailman/interfaces/user.py b/src/mailman/interfaces/user.py
index ad1ac9282..8d0cbfb54 100644
--- a/src/mailman/interfaces/user.py
+++ b/src/mailman/interfaces/user.py
@@ -17,7 +17,7 @@
"""Interface describing the basics of a user."""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
@@ -28,27 +28,20 @@ __all__ = [
from zope.interface import Interface, Attribute
-from mailman.interfaces.errors import MailmanError
+from mailman.interfaces.address import AddressError
-class UnverifiedAddressError(MailmanError):
+class UnverifiedAddressError(AddressError):
"""Unverified address cannot be used as a user's preferred address."""
- def __init__(self, address):
- super(UnverifiedAddressError, self).__init__()
- self.address = address
-
- def __str__(self):
- return self.address
-
class IUser(Interface):
"""A basic user."""
- real_name = Attribute(
- """This user's real name.""")
+ display_name = Attribute(
+ """This user's display name.""")
password = Attribute(
"""This user's password information.""")
@@ -68,17 +61,17 @@ class IUser(Interface):
memberships = Attribute(
"""A roster of this user's memberships.""")
- def register(email, real_name=None):
+ def register(email, display_name=None):
"""Register the given email address and link it to this user.
:param email: The text email address to register.
:type email: str
- :param real_name: The user's real name. If not given the empty string
- is used.
- :type real_name: str
+ :param display_name: The user's display name. If not given the empty
+ string is used.
+ :type display_name: str
:return: The address object linked to the user. If the associated
address object already existed (unlinked to a user) then the
- `real_name` parameter is ignored.
+ `display_name` parameter is ignored.
:rtype: `IAddress`
:raises AddressAlreadyLinkedError: if this `IAddress` is already
linked to another user.