diff options
| author | Barry Warsaw | 2007-11-07 06:55:13 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2007-11-07 06:55:13 -0500 |
| commit | c8940f127f99071cb4f256007ece39e6a14a5302 (patch) | |
| tree | 41fba10cdfe345d0af3d318f7fdb9d1e76ef7e0e /Mailman/database/model/user.py | |
| parent | d6377c92857c513faf484ef9a91a6b00da789d4b (diff) | |
| download | mailman-c8940f127f99071cb4f256007ece39e6a14a5302.tar.gz mailman-c8940f127f99071cb4f256007ece39e6a14a5302.tar.zst mailman-c8940f127f99071cb4f256007ece39e6a14a5302.zip | |
Fix two doctests: addresses.txt and mlist-addresses.txt
Remove flush() altogether. Yee-haw! Rework queries to be Stormy. Fix
doctests to be Unicode-ish.
Diffstat (limited to 'Mailman/database/model/user.py')
| -rw-r--r-- | Mailman/database/model/user.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/database/model/user.py b/Mailman/database/model/user.py index 7be54c3c4..2d87b9648 100644 --- a/Mailman/database/model/user.py +++ b/Mailman/database/model/user.py @@ -20,6 +20,7 @@ from storm.locals import * from zope.interface import implements from Mailman import Errors +from Mailman.configuration import config from Mailman.database import Model from Mailman.database.model import Address from Mailman.database.model import Preferences @@ -52,8 +53,11 @@ class User(Model): address.user = None def controls(self, address): - found = Address.get_by(address=address) - return bool(found and found.user is self) + found = config.db.store.find(Address, address=address) + if found.count() == 0: + return False + assert found.count() == 1, 'Unexpected count' + return found[0].user is self def register(self, address, real_name=None): # First, see if the address already exists |
