Skip to content

Commit d8463fd

Browse files
committed
merge.
2 parents 3f69c89 + c7900af commit d8463fd

File tree

7 files changed

+74
-15
lines changed

7 files changed

+74
-15
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Fixed:
1313

1414
- issue2550574: Restore sample detectors removed in roundup 1.4.9
1515
(Thomas Arendsen Hein)
16+
- Prevent AttributeError when removing all roles of a user
17+
(Thomas Arendsen Hein)
18+
- issue2550762 Minor Documentation fix in doc/developers.txt, thanks
19+
to W. Trevor King. (Bernhard Reiter)
1620

1721

1822
2012-05-15: 1.4.20

doc/developers.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ Website, wiki
3333
Issue Tracker
3434
-------------
3535

36-
The tracker resides on psf.upfronthosting.co.za. The roundup installation
37-
belongs to the user roundup. In ~roundup, all trackers are stored and
38-
the roundup code itself. roundup is started through /etc/init.d/roundup;
36+
The tracker resides on psf.upfronthosting.co.za.
37+
(2012-07-04) 2048 c4:ad:63:92:1b:c0:4a:35:c8:c5:3e:96:51:c0:88:67 (RSA)
38+
39+
The roundup installation belongs to the user roundup.
40+
In ~roundup, all trackers are stored and the roundup code itself.
41+
roundup is started through /etc/init.d/roundup;
3942
other parts of the installation are started through
4043
/etc/init.d/{postgresql-8-1,spambayes,postfix}.
4144

@@ -46,8 +49,8 @@ In this tracker, Upfronthosting people are the users izak and roche.
4649
The Roundup tracker http://issues.roundup-tracker.org/ is in
4750
~roundup/trackers/roundup
4851

49-
The configuration is in the "web/trunk/issues" section of Roundup's
50-
Subversion repository and copied manually to the live tracker.
52+
The configuration is in the "website/issues" section of Roundup's
53+
Mercurical SCM repository and copied manually to the live tracker.
5154

5255
A checkout of the roundup sources is in ~roundup/src/roundup-src.
5356

roundup/cgi/engine_chameleon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get(self, name, extension=None):
2323
src, filename = find_template(self.dir, name, extension)
2424
return RoundupPageTemplate(self.loader.load(src))
2525

26-
class RoundupPageTemplate():
26+
class RoundupPageTemplate(object):
2727
def __init__(self, pt):
2828
self._pt = pt
2929

@@ -36,7 +36,7 @@ def translate(msgid, domain=None, mapping=None, default=None):
3636
mapping=mapping, default=default)
3737
return unicode(result, client.translator.OUTPUT_ENCODING)
3838

39-
output = self._pt.render(None, translate, None, **c)
39+
output = self._pt.render(None, translate, **c)
4040
return output.encode(client.charset)
4141

4242
def __getitem__(self, name):

share/roundup/templates/classic/detectors/userauditor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@ def audit_user_fields(db, cl, nodeid, newvalues):
5858

5959
for address in get_addresses(newvalues):
6060
if not valid_address(address):
61-
raise ValueError, 'Email address syntax is invalid'
61+
raise ValueError, 'Email address syntax is invalid "%s"'%address
6262

6363
check_main = db.user.stringFind(address=address)
6464
# make sure none of the alts are owned by anyone other than us (x!=nodeid)
6565
check_alts = [x for x in db.user.filter(None, {'alternate_addresses' : address}) if x != nodeid]
6666
if check_main or check_alts:
6767
raise ValueError, 'Email address %s already in use' % address
6868

69-
for rolename in [r.lower().strip() for r in newvalues.get('roles', '').split(',')]:
69+
newroles = newvalues.get('roles')
70+
if newroles:
71+
for rolename in [r.lower().strip() for r in newroles.split(',')]:
7072
if rolename and not db.security.role.has_key(rolename):
7173
raise ValueError, 'Role "%s" does not exist'%rolename
7274

share/roundup/templates/devel/detectors/userauditor.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# Copyright (c) 2003 Richard Jones ([email protected])
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
#
21+
122
import re
223

324
# regular expression thanks to: http://www.regular-expressions.info/email.html
@@ -37,7 +58,6 @@ def audit_user_fields(db, cl, nodeid, newvalues):
3758

3859
for address in get_addresses(newvalues):
3960
if not valid_address(address):
40-
print newvalues
4161
raise ValueError, 'Email address syntax is invalid "%s"'%address
4262

4363
check_main = db.user.stringFind(address=address)
@@ -46,7 +66,9 @@ def audit_user_fields(db, cl, nodeid, newvalues):
4666
if check_main or check_alts:
4767
raise ValueError, 'Email address %s already in use' % address
4868

49-
for rolename in [r.lower().strip() for r in newvalues.get('roles', '').split(',')]:
69+
newroles = newvalues.get('roles')
70+
if newroles:
71+
for rolename in [r.lower().strip() for r in newroles.split(',')]:
5072
if rolename and not db.security.role.has_key(rolename):
5173
raise ValueError, 'Role "%s" does not exist'%rolename
5274

@@ -69,3 +91,5 @@ def init(db):
6991
# fire before changes are made
7092
db.user.audit('set', audit_user_fields)
7193
db.user.audit('create', audit_user_fields)
94+
95+
# vim: sts=4 sw=4 et si

share/roundup/templates/minimal/detectors/userauditor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@ def audit_user_fields(db, cl, nodeid, newvalues):
5858

5959
for address in get_addresses(newvalues):
6060
if not valid_address(address):
61-
raise ValueError, 'Email address syntax is invalid'
61+
raise ValueError, 'Email address syntax is invalid "%s"'%address
6262

6363
check_main = db.user.stringFind(address=address)
6464
# make sure none of the alts are owned by anyone other than us (x!=nodeid)
6565
check_alts = [x for x in db.user.filter(None, {'alternate_addresses' : address}) if x != nodeid]
6666
if check_main or check_alts:
6767
raise ValueError, 'Email address %s already in use' % address
6868

69-
for rolename in [r.lower().strip() for r in newvalues.get('roles', '').split(',')]:
69+
newroles = newvalues.get('roles')
70+
if newroles:
71+
for rolename in [r.lower().strip() for r in newroles.split(',')]:
7072
if rolename and not db.security.role.has_key(rolename):
7173
raise ValueError, 'Role "%s" does not exist'%rolename
7274

website/issues/detectors/userauditor.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# Copyright (c) 2003 Richard Jones ([email protected])
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
#
21+
122
import re
223

324
# regular expression thanks to: http://www.regular-expressions.info/email.html
@@ -37,7 +58,6 @@ def audit_user_fields(db, cl, nodeid, newvalues):
3758

3859
for address in get_addresses(newvalues):
3960
if not valid_address(address):
40-
print newvalues
4161
raise ValueError, 'Email address syntax is invalid "%s"'%address
4262

4363
check_main = db.user.stringFind(address=address)
@@ -46,7 +66,9 @@ def audit_user_fields(db, cl, nodeid, newvalues):
4666
if check_main or check_alts:
4767
raise ValueError, 'Email address %s already in use' % address
4868

49-
for rolename in [r.lower().strip() for r in newvalues.get('roles', '').split(',')]:
69+
newroles = newvalues.get('roles')
70+
if newroles:
71+
for rolename in [r.lower().strip() for r in newroles.split(',')]:
5072
if rolename and not db.security.role.has_key(rolename):
5173
raise ValueError, 'Role "%s" does not exist'%rolename
5274

@@ -69,3 +91,5 @@ def init(db):
6991
# fire before changes are made
7092
db.user.audit('set', audit_user_fields)
7193
db.user.audit('create', audit_user_fields)
94+
95+
# vim: sts=4 sw=4 et si

0 commit comments

Comments
 (0)