# has to be in the commands group
if command not in self.universe.groups["command"].values():
- result = False
+ return(False)
# avatars of administrators can run any command
- elif self.owner and self.owner.account.get("administrator"):
- result = True
+ if self.owner and self.owner.account.get("administrator"):
+ return(True)
# everyone can run non-administrative commands
- elif not command.get("administrative"):
- result = True
+ if not command.get("administrative"):
+ return(True)
# otherwise the command cannot be run by this actor
- else:
- result = False
-
- # pass back the result
- return result
+ return(False)
def update_location(self):
"""Make sure the location's contents contain this element."""
expanded.append(key)
# return one at random
- # Whitelist the random.randrange() call in bandit since it's not used for
+ # Allow the random.randrange() call in bandit since it's not used for
# security/cryptographic purposes
return random.choice(expanded) # nosec
name = ""
# create a name of random length from the syllables
- # Whitelist the random.randrange() call in bandit since it's not used for
+ # Allow the random.randrange() call in bandit since it's not used for
# security/cryptographic purposes
for _syllable in range(random.randrange(2, 6)): # nosec
name += weighted_choice(syllables)