Skip to content

Commit

Permalink
Applied some fixes suggested by @withshubh in #1260
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Mar 29, 2021
1 parent f92d823 commit d579fcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions datasette/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def __init__(
loader=template_loader, autoescape=True, enable_async=True
)
self.jinja_env.filters["escape_css_string"] = escape_css_string
self.jinja_env.filters["quote_plus"] = lambda u: urllib.parse.quote_plus(u)
self.jinja_env.filters["quote_plus"] = urllib.parse.quote_plus
self.jinja_env.filters["escape_sqlite"] = escape_sqlite
self.jinja_env.filters["to_css_class"] = to_css_class
# pylint: disable=no-member
Expand Down Expand Up @@ -767,7 +767,7 @@ def _register_renderers(self):
hook_renderers = []
# pylint: disable=no-member
for hook in pm.hook.register_output_renderer(datasette=self):
if type(hook) == list:
if type(hook) is list:
hook_renderers += hook
else:
hook_renderers.append(hook)
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/my_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def permission_allowed(actor, action):
elif action == "this_is_denied":
return False
elif action == "view-database-download":
return (actor and actor.get("can_download")) or None
return actor.get("can_download") if actor else None


@hookimpl
Expand Down

0 comments on commit d579fcf

Please sign in to comment.