Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files as templates #56

Merged
merged 5 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
syntax++, PEP 8: E713
  • Loading branch information
nerdoc committed Apr 5, 2024
commit d33298f3e6bf3087047866e275b35c2e53abd2bf
4 changes: 2 additions & 2 deletions tetra/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def __call__(self, request):
raise TetraMiddlewareException(
"{% tetra_styles %} tag required to be place in the page <head> when using Tetra components."
)
if not request.tetra_scripts_placeholder_string in response.content:
if request.tetra_scripts_placeholder_string not in response.content:
raise TetraMiddlewareException(
"Placeholder from {% tetra_scripts %} not found."
)
if not request.tetra_styles_placeholder_string in response.content:
if request.tetra_styles_placeholder_string not in response.content:
raise TetraMiddlewareException(
"Placeholder from {% tetra_styles %} not found."
)
Expand Down
2 changes: 1 addition & 1 deletion tetra/templatetags/tetra.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def styles_placeholder_tag(context):


def token_attr(bit, parser):
if not "=" in bit:
if "=" not in bit:
return {}
name, value = bit.split("=", 1)
return {name: parser.compile_filter(value)}
Expand Down
2 changes: 1 addition & 1 deletion tetra/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def component_method(request, app_name, library_name, component_name, method_nam
except KeyError:
return HttpResponseNotFound()

if not method_name in (m["name"] for m in Component._public_methods):
if method_name not in (m["name"] for m in Component._public_methods):
return HttpResponseNotFound()

try:
Expand Down