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

Remove the Jinja2 templating base64-encoding filter #1600

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
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
13 changes: 0 additions & 13 deletions betty/jinja2/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import re
import warnings
from asyncio import get_running_loop, run
from base64 import b64encode
from contextlib import suppress
from io import BytesIO
from typing import (
Expand Down Expand Up @@ -55,7 +54,6 @@
camel_case_to_kebab_case,
upper_camel_case_to_lower_camel_case,
)
from betty.warnings import deprecated

if TYPE_CHECKING:
from jinja2.nodes import EvalContext
Expand Down Expand Up @@ -533,16 +531,6 @@ def filter_select_dateds(
)


@deprecated(
"This function is deprecated as of Betty 0.3.4, and will be removed in Betty 0.4.x. Instead, use the `hashid` filter."
)
def filter_base64(source: str) -> str:
"""
Base-64-encode a string.
"""
return b64encode(source.encode("utf-8")).decode("utf-8")


def filter_hashid(source: str) -> str:
"""
Create a hash ID.
Expand Down Expand Up @@ -573,7 +561,6 @@ def filter_public_js(context: Context, public_path: str) -> None:


FILTERS = {
"base64": filter_base64,
"camel_case_to_kebab_case": camel_case_to_kebab_case,
"camel_case_to_snake_case": camel_case_to_snake_case,
"entity_type_name": get_entity_type_name,
Expand Down
Loading