summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/member.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-04-22 19:26:43 -0400
committerBarry Warsaw2011-04-22 19:26:43 -0400
commitb5b015ce524157cfef4b795e4b0c7ff17b4d0fe2 (patch)
tree260169450ab382cf59143f0fe8bae0fc0507452f /src/mailman/interfaces/member.py
parent6959e6adcb582172aeec01ef6b6a75b9ba85017b (diff)
downloadmailman-b5b015ce524157cfef4b795e4b0c7ff17b4d0fe2.tar.gz
mailman-b5b015ce524157cfef4b795e4b0c7ff17b4d0fe2.tar.zst
mailman-b5b015ce524157cfef4b795e4b0c7ff17b4d0fe2.zip
Give IMembers a unique member id. We have to do this in order to give them a
path at the root of the resource tree (i.e. /members/X) and because when members can be subscribed by their IUser record (for preferred address), their canonical location cannot contain the address they are subscribed with. When their preferred address changes (without otherwise touching their membership), this address will change and that's not good for a canonical location. Other changes: * Added IMember.member_id attribute * Added ISubscriptionService.get_member() so member records can be retrieve by member id. * We can now get individual members by id via the REST API. * Extend the UniqueIDFactory so that it can take a 'context' (defaulting to None). The context is only used in the testing infrastructure so that separate files can be used for user ids and member ids. Otherwise, we'd have gaps in those sequences. * When *not* in testing mode, ensure that UIDs cannot be reused by keeping a table of all UIDs ever handed out. We *should* never get collisions, but this ensures it. * Clean up mailman.sql
Diffstat (limited to 'src/mailman/interfaces/member.py')
-rw-r--r--src/mailman/interfaces/member.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mailman/interfaces/member.py b/src/mailman/interfaces/member.py
index a5e693411..fc635f21c 100644
--- a/src/mailman/interfaces/member.py
+++ b/src/mailman/interfaces/member.py
@@ -121,6 +121,9 @@ class NotAMemberError(MembershipError):
class IMember(Interface):
"""A member of a mailing list."""
+ member_id = Attribute(
+ """The member's unique, random identifier (sha1 hex digest).""")
+
mailing_list = Attribute(
"""The mailing list subscribed to.""")