Skip to content
Snippets Groups Projects

Hotfix/voucher templates

Merged Carlos Vega requested to merge hotfix/voucher_templates into master
12 files
+ 198
37
Compare changes
  • Side-by-side
  • Inline
Files
12
+ 24
0
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(MailTemplateForm, self).__init__(*args, **kwargs)
instance = getattr(self, 'instance', None)
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(MailTemplateForm, self).clean()
return cleaned_data
\ No newline at end of file
Loading