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
Commits
2014222f
Commit
2014222f
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
configuration params for sending emails
parent
ce47c0f3
No related branches found
No related tags found
1 merge request
!42
Email functionality
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/migrations/0032_configurationitem_email_items.py
+46
-0
46 additions, 0 deletions
smash/web/migrations/0032_configurationitem_email_items.py
smash/web/models/constants.py
+8
-0
8 additions, 0 deletions
smash/web/models/constants.py
with
54 additions
and
0 deletions
smash/web/migrations/0032_configurationitem_email_items.py
0 → 100644
+
46
−
0
View file @
2014222f
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-04 09:43
from
__future__
import
unicode_literals
from
django.db
import
migrations
from
web.models.constants
import
EMAIL_HOST_CONFIGURATION_TYPE
,
\
EMAIL_PORT_CONFIGURATION_TYPE
,
\
EMAIL_USER_CONFIGURATION_TYPE
,
\
EMAIL_PASSWORD_CONFIGURATION_TYPE
,
\
EMAIL_CONFIGURATION_TYPE
,
\
KIT_RECIPIENT_EMAIL_CONFIGURATION_TYPE
,
\
KIT_DAILY_EMAIL_HOUR_CONFIGURATION_TYPE
def
create_item
(
apps
,
type
,
value
,
name
):
# We can't import the ConfigurationItem model directly as it may be a newer
# version than this migration expects. We use the historical version.
ConfigurationItem
=
apps
.
get_model
(
"
web
"
,
"
ConfigurationItem
"
)
item
=
ConfigurationItem
.
objects
.
create
()
item
.
type
=
type
item
.
value
=
value
item
.
name
=
name
item
.
save
()
def
configuration_items
(
apps
,
schema_editor
):
create_item
(
apps
,
EMAIL_HOST_CONFIGURATION_TYPE
,
"
smtp.example.com
"
,
"
SMTP host
"
)
create_item
(
apps
,
EMAIL_PORT_CONFIGURATION_TYPE
,
"
25
"
,
"
SMTP port
"
)
create_item
(
apps
,
EMAIL_USER_CONFIGURATION_TYPE
,
"
your_login
"
,
"
SMTP username
"
)
create_item
(
apps
,
EMAIL_PASSWORD_CONFIGURATION_TYPE
,
"
your_password
"
,
"
SMTP password
"
)
create_item
(
apps
,
EMAIL_CONFIGURATION_TYPE
,
"
sent.from@email.lu
"
,
"
System email address
"
)
create_item
(
apps
,
KIT_RECIPIENT_EMAIL_CONFIGURATION_TYPE
,
"
kit.receipents@lu;with.semicolon@separation.lu
"
,
"
Recipients of kit requests email
"
)
create_item
(
apps
,
KIT_DAILY_EMAIL_HOUR_CONFIGURATION_TYPE
,
"
17:00
"
,
"
At what time kit request emails should be sent
"
)
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
web
'
,
'
0031_appointment_post_mail_sent
'
),
]
operations
=
[
migrations
.
RunPython
(
configuration_items
),
]
This diff is collapsed.
Click to expand it.
smash/web/models/constants.py
+
8
−
0
View file @
2014222f
...
...
@@ -30,3 +30,11 @@ CONTACT_TYPES_CHOICES = (
CANCELLED_APPOINTMENT_COLOR_CONFIGURATION_TYPE
=
"
CANCELLED_APPOINTMENT_COLOR
"
NO_SHOW_APPOINTMENT_COLOR_CONFIGURATION_TYPE
=
"
NO_SHOW_APPOINTMENT_COLOR
"
EMAIL_HOST_CONFIGURATION_TYPE
=
"
EMAIL_HOST_CONFIGURATION_TYPE
"
EMAIL_PORT_CONFIGURATION_TYPE
=
"
EMAIL_PORT_CONFIGURATION_TYPE
"
EMAIL_USER_CONFIGURATION_TYPE
=
"
EMAIL_USER_CONFIGURATION_TYPE
"
EMAIL_PASSWORD_CONFIGURATION_TYPE
=
"
EMAIL_PASSWORD_CONFIGURATION_TYPE
"
EMAIL_CONFIGURATION_TYPE
=
"
EMAIL_CONFIGURATION_TYPE
"
KIT_RECIPIENT_EMAIL_CONFIGURATION_TYPE
=
"
KIT_RECIPIENT_EMAIL_CONFIGURATION_TYPE
"
KIT_DAILY_EMAIL_HOUR_CONFIGURATION_TYPE
=
"
KIT_DAILY_EMAIL_HOUR_CONFIGURATION_TYPE
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment