Provide api calls for permitting helpdesk users to access user information by user...
[astakos] / snf-astakos-app / astakos / im / management / commands / listusers.py
index 48e78b8..839689c 100644 (file)
@@ -64,8 +64,8 @@ class Command(BaseCommand):
         if options['pending']:
             users = users.filter(is_active=False)
         
-        labels = ('id', 'email', 'real name', 'affiliation', 'active', 'admin', 'provider')
-        columns = (3, 24, 24, 12, 6, 5, 12)
+        labels = ('id', 'email', 'real name', 'active', 'admin', 'provider', 'groups')
+        columns = (3, 24, 24, 6, 5, 12,  24)
         
         if not options['csv']:
             line = ' '.join(l.rjust(w) for l, w in zip(labels, columns))
@@ -77,8 +77,8 @@ class Command(BaseCommand):
             id = str(user.id)
             active = format_bool(user.is_active)
             admin = format_bool(user.is_superuser)
-            fields = (id, user.email, user.realname, user.affiliation, active,
-                      admin, user.provider)
+            fields = (id, user.email, user.realname, active, admin, user.provider,
+                      ','.join([g.name for g in user.groups.all()]))
             
             if options['csv']:
                 line = '|'.join(fields)