mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Applied some fixes suggested by @withshubh in #1260
This commit is contained in:
parent
f92d823766
commit
d579fcf4f7
2 changed files with 3 additions and 3 deletions
|
|
@ -317,7 +317,7 @@ class Datasette:
|
|||
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
|
||||
|
|
@ -767,7 +767,7 @@ class Datasette:
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue