diff options
| author | Barry Warsaw | 2007-06-15 00:50:40 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-06-15 00:50:40 -0400 |
| commit | 067f871fdcaf51a0de8a1468006d3bad2e3a9a24 (patch) | |
| tree | 8404972f48ad55b4a2353c2f33369fb51351e500 /Mailman/interfaces/user.py | |
| parent | 125f16ea72934e4dd18529a597b155c0aaca9ff6 (diff) | |
| download | mailman-067f871fdcaf51a0de8a1468006d3bad2e3a9a24.tar.gz mailman-067f871fdcaf51a0de8a1468006d3bad2e3a9a24.tar.zst mailman-067f871fdcaf51a0de8a1468006d3bad2e3a9a24.zip | |
Update the IUser interface and tests, specifically as it relates to
preferences. IAddresses, IUsers, and IMembers all get preferences by default,
althoughthe attributes of these preferences are None by default.
IMailingLists don't get preferences by default though; because these live in
the user database, we can't cross-polinate them in the mailing lists. We'll
figure something out later for these.
IUser.register(): Add this method which registers and links an address to the
user.
Allow EnumType database columns to accept and return Nones. This is useful
for when the columns are not defined NOT NULL.
Update doctests.
Removed teh hide_address preference. I can't think of a reason not to want to
hide addresses for everyone.
Diffstat (limited to 'Mailman/interfaces/user.py')
| -rw-r--r-- | Mailman/interfaces/user.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Mailman/interfaces/user.py b/Mailman/interfaces/user.py index 9e89c2416..f7647597d 100644 --- a/Mailman/interfaces/user.py +++ b/Mailman/interfaces/user.py @@ -30,19 +30,21 @@ class IUser(Interface): password = Attribute( """This user's password information.""") - preferences = Attribute( - """The default preferences for this user.""") - addresses = Attribute( """An iterator over all the IAddresses controlled by this user.""") - def register(address): + def register(address, real_name=None): """Register the given email address and link it to this user. In this case, 'address' is a text email address, not an IAddress - object. Raises AddressAlreadyLinkedError if this IAddress is already - linked to another user. If the corresponding IAddress already exists - but is not linked, then it is simply linked to the user. + object. If real_name is not given, the empty string is used. + + Raises AddressAlreadyLinkedError if this IAddress is already linked to + another user. If the corresponding IAddress already exists but is not + linked, then it is simply linked to the user, in which case + real_name is ignored. + + Return the new IAddress object. """ def link(address): @@ -66,3 +68,6 @@ class IUser(Interface): 'address' is a text email address. This method returns true if the user controls the given email address, otherwise false. """ + + preferences = Attribute( + """This user's preferences.""") |
