Better (and correct) output from the 'groups' command.

This commit is contained in:
Griatch 2010-09-04 14:19:07 +00:00
parent 39e66dbc34
commit 7d8edf0235

View file

@ -672,13 +672,14 @@ class CmdGroup(MuxCommand):
string += "\n This is a SUPERUSER account! Group membership does not matter." string += "\n This is a SUPERUSER account! Group membership does not matter."
else: else:
# get permissions and determine if they are groups # get permissions and determine if they are groups
perms = [perm.strip().lower() for perm in caller.player.permissions perms = list(set(caller.permissions + caller.player.permissions))
if perm.strip()]
for group in [group for group in PermissionGroup.objects.all() for group in [group for group in PermissionGroup.objects.all()
if group.key.lower() in perms]: if group.key in perms]:
string += "\n %s\t\t%s" % (group.key, [str(perm) for perm in group.group_permissions]) string += "\n {w%s{n\n%s" % (group.key, ", ".join(group.group_permissions))
if string: if string:
string = "\nYour (%s's) group memberships: %s" % (caller.name, string) string = "\nGroup memberships for you (Player %s + Character %s): %s" % (caller.player.name,
caller.name, string)
else: else:
string = "\nYou are not not a member of any groups." string = "\nYou are not not a member of any groups."
caller.msg(string) caller.msg(string)