Verified Commit a1815aa6 authored by Jakob Moser's avatar Jakob Moser
Browse files

Reformat files

parent 651e1766
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -13,4 +13,8 @@ class FachschaftCertification(Certification):
    required_office_kind_name: ClassVar[str] = "Fachschaft"

    def html(self, locale: Locale) -> str:
        return fill_template(get_template("commitment_certification/fachschaft", locale), locale, certification=self)
        return fill_template(
            get_template("commitment_certification/fachschaft", locale),
            locale,
            certification=self,
        )
+4 −2
Original line number Diff line number Diff line
@@ -18,5 +18,7 @@ certification_classes: Mapping[str, type[ColiCertification]] = {

def from_dict(certification_request: dict[str, Any]) -> ColiCertification:
    # Variable name has a capital C, because it is a class, so this makes the next line look nicer
    Certification = certification_classes[certification_request["office"]["kind"]["name"]]  # noqa: N806
    Certification = certification_classes[
        certification_request["office"]["kind"]["name"]
    ]  # noqa: N806
    return Certification.from_dict(certification_request)
+1 −3
Original line number Diff line number Diff line
@@ -91,9 +91,7 @@ def _convert_single_guessing_output_path(
    output_file_path.parent.mkdir(parents=True, exist_ok=True)

    try:
        _convert_single(
            input_file_path, output_file_path, output_format, document_type
        )
        _convert_single(input_file_path, output_file_path, output_format, document_type)
    except TransformError:
        # TODO This is spectacularly ugly: As I know this function is called during batch processing, and I decided I
        #  want to silently ignore errors in batch processing (actually, I just want to replicate the behavior that
+4 −1
Original line number Diff line number Diff line
@@ -3,7 +3,10 @@ from jinja2 import Template, PackageLoader, select_autoescape, Environment, Choi
from pdf_generator.jinja.filters import format_date

_env = Environment(
    loader=ChoiceLoader((PackageLoader("coliverter.resources"), PackageLoader("pdf_generator"))), autoescape=select_autoescape()
    loader=ChoiceLoader(
        (PackageLoader("coliverter.resources"), PackageLoader("pdf_generator"))
    ),
    autoescape=select_autoescape(),
)
_env.filters["format_date"] = format_date