Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
transporte
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Logistik
transporte
Commits
775d3144
Unverified
Commit
775d3144
authored
2 years ago
by
hanfi
Browse files
Options
Downloads
Patches
Plain Diff
make zammad/mail toggleable for development
parent
2b1cc21f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
transporte/config.cfg.example
+3
-1
3 additions, 1 deletion
transporte/config.cfg.example
transporte/models.py
+11
-8
11 additions, 8 deletions
transporte/models.py
transporte/views.py
+10
-8
10 additions, 8 deletions
transporte/views.py
with
24 additions
and
17 deletions
transporte/config.cfg.example
+
3
−
1
View file @
775d3144
...
...
@@ -15,6 +15,7 @@ SPECIAL_HELPDESK_ACCOUNTS = [{
}]
# mail server config
MAIL_ENABLE = True
MAIL_SERVER = 'SMTP_HOST'
MAIL_PORT = 587
MAIL_USE_TLS = True
...
...
@@ -23,7 +24,8 @@ MAIL_USERNAME = 'SMTP_USER'
MAIL_PASSWORD = 'SMTP_PASS'
MAIL_DEFAULT_SENDER = 'no-reply@YOURDOMAIN.de'
# zammad integration config
ZAMMAD_ENABLE = True
ZAMMAD_HOST = 'zammad host'
ZAMMAD_USER = 'user'
ZAMMAD_PASS = 'pass'
...
...
This diff is collapsed.
Click to expand it.
transporte/models.py
+
11
−
8
View file @
775d3144
...
...
@@ -36,7 +36,10 @@ class User(UserMixin, db.Model):
return
# send login email
msg
=
Message
(
"
Your LOC transport tool credentials!
"
,
recipients
=
[
self
.
login
])
if
app
.
config
[
"
MAIL_ENABLE
"
]:
msg
=
Message
(
"
Your LOC transport tool credentials!
"
,
recipients
=
[
self
.
login
]
)
msg
.
body
=
(
"
Hi, na!
\n\n
"
"
Thank you for helping us keeping an overview of your transports :)
\n
"
...
...
This diff is collapsed.
Click to expand it.
transporte/views.py
+
10
−
8
View file @
775d3144
...
...
@@ -190,6 +190,7 @@ def edit_transport(id=None):
#
# if ticket is new, update object with zammad ticket id
#
if
app
.
config
[
"
ZAMMAD_ENABLE
"
]:
if
transport
.
ticket_id
is
None
:
transport
.
ticket_id
=
update_ticket
(
transport
)
db
.
session
.
add
(
transport
)
...
...
@@ -322,6 +323,7 @@ def mark_transport(mark, id=None):
#
# close ticket
#
if
app
.
config
[
"
ZAMMAD_ENABLE
"
]:
if
transport
.
ticket_id
:
close_ticket
(
transport
,
mark
)
...
...
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