Skip to content

Commit

Permalink
Re-run black with updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
smk4664 committed Feb 21, 2023
1 parent e46654d commit d3901f6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions nautobot_chatops/workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,9 @@ def second_subcommand(dispatcher, arg_1):
if subcommand == "help" or not subcommand:
message = f"I know the following `{dispatcher.command_prefix}{command}` subcommands:\n"
for subcmd, entry in registry[command].get("subcommands", {}).items():
if (
settings.PLUGINS_CONFIG["nautobot_chatops"].get("restrict_help")
and not AccessGrant.objects.filter(
Q(command="*") | Q(command=command, subcommand="*") | Q(command=command, subcommand=subcmd),
)
.filter(grant_type=AccessGrantTypeChoices.TYPE_USER)
.filter(Q(value="*") | Q(value=context["user_id"]))
):
if settings.PLUGINS_CONFIG["nautobot_chatops"].get("restrict_help") and not AccessGrant.objects.filter(
Q(command="*") | Q(command=command, subcommand="*") | Q(command=command, subcommand=subcmd),
).filter(grant_type=AccessGrantTypeChoices.TYPE_USER).filter(Q(value="*") | Q(value=context["user_id"])):
continue
message += (
f"- `{dispatcher.command_prefix}{command} {subcmd} "
Expand Down

0 comments on commit d3901f6

Please sign in to comment.