Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
mail_template.py 754 B
from django import forms
from django.forms import ModelForm
from web.models import MailTemplate

import logging
logger = logging.getLogger(__name__)

class MailTemplateForm(ModelForm):
    class Meta:
        model = MailTemplate
        fields = '__all__'

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.fields['Multilingual'] = forms.BooleanField(label='Multilingual', disabled=True, required=False,
        	help_text='Only for voucher context. Check this option if the voucher template is multilingual.',
        	widget=forms.CheckboxInput(attrs={'class': 'hidden_form_field', 'id': 'multilingual_checkbox'}))

    def clean(self):
        cleaned_data = super().clean()
        return cleaned_data