Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Merge requests
!185
Hotfix/voucher templates
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Hotfix/voucher templates
hotfix/voucher_templates
into
master
Overview
0
Commits
10
Pipelines
2
Changes
12
Merged
Carlos Vega
requested to merge
hotfix/voucher_templates
into
master
6 years ago
Overview
0
Commits
10
Pipelines
2
Changes
12
Expand
Closes
#266 (closed)
and
#267 (closed)
0
0
Merge request reports
Compare
master
version 1
ac64180f
6 years ago
master (base)
and
latest version
latest version
e86ee025
10 commits,
6 years ago
version 1
ac64180f
9 commits,
6 years ago
12 files
+
198
−
37
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
smash/web/forms/mail_template.py
0 → 100644
+
24
−
0
Options
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