Verified Commit 82c94f1e authored by Jakob Moser's avatar Jakob Moser
Browse files

Add AwarenessCertification class

parent f4976d87
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
from dataclasses import dataclass
from typing import ClassVar

from pdf_generator.commitment_certification.Certification import Certification
from pdf_generator.jinja.templates import fill_template
from babel.core import Locale

from coliverter.resources.templates.get_template import get_template


@dataclass(frozen=True)
class AwarenessCertification(Certification):
    required_office_kind_name: ClassVar[str] = "Awareness"

    def html(self, locale: Locale) -> str:
        return fill_template(
            get_template("commitment_certification/awareness", locale),
            locale,
            certification=self,
        )
+2 −1
Original line number Diff line number Diff line
from collections.abc import Mapping
from typing import Any, get_args

from coliverter.certifications.AwarenessCertification import AwarenessCertification
from coliverter.certifications.FachschaftCertification import FachschaftCertification

# The types of certification the coliverter can produce
type ColiCertification = FachschaftCertification
type ColiCertification = FachschaftCertification | AwarenessCertification

certification_classes: Mapping[str, type[ColiCertification]] = {
    cls.required_office_kind_name: cls