bodhi/model.py | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
New commits:
commit 2e0f2a8220b12686263d1b686138ac8525c181bd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 17 18:10:41 2010 -0400
Don't add the admin group to the commenter name if they're bodhi or anonymous
diff --git a/bodhi/model.py b/bodhi/model.py
index c76fcdd..55bb9fe 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -701,19 +701,20 @@ class PackageUpdate(SQLObject):
if not author: author = identity.current.user_name
critpath_approved = self.critpath_approved
- # Hack: Add admin groups to usernames (eg: "lmacken (releng)")
- admin_groups = config.get('admin_groups',
- 'releng qa security_respons').split()
+ # Add admin groups to usernames (eg: "lmacken (releng)")
+ if not anonymous and author != 'bodhi':
+ admin_groups = config.get('admin_groups',
+ 'releng qa security_respons').split()
- try:
- for group in identity.current.groups:
- if group in admin_groups:
- author += ' (%s)' % group
- break
- except RequestRequiredException:
- # This happens when we're adding comments from the masher,
- # in which case this block is not necessary
- pass
+ try:
+ for group in list(identity.current.groups)[::-1]:
+ if group in admin_groups:
+ author += ' (%s)' % group
+ break
+ except RequestRequiredException:
+ # This happens when we're adding comments from the masher,
+ # in which case this block is not necessary
+ pass
if not anonymous and karma != 0 and \
not filter(lambda c: c.author == author and c.karma == karma,
Show replies by date