Better (and correct) output from the 'groups' command.
This commit is contained in:
parent
39e66dbc34
commit
7d8edf0235
1 changed files with 6 additions and 5 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue