"""This module holds the custom qrcodes of the ``trainings`` app."""

from mtp.apps.qrcodes.qrcode import ObjectQRCode


class ActivityQRCode(ObjectQRCode):
    """An activity QRCode.

    Notes
    -----
    This class is used to generate an image containing a QRCode.
    The QRCode contains information allowing the client to launch a specific training activity.

    """

    def _get_qrcode_context_data(self, **kwargs):
        """Get the qrcode context data.

        Returns
        -------
        dict
            The wanted context data.

        """

        activity_data = self.get_object().get_qrcode_data()
        return super()._get_qrcode_context_data(**activity_data)
