Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
protokollsystem
proto3
Commits
7fdc3464
Commit
7fdc3464
authored
7 years ago
by
Robin Sonnabend
Browse files
Options
Downloads
Patches
Plain Diff
Add option for additional todomail providers
/close
#76
parent
6e6f7935
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config.py.example
+9
-0
9 additions, 0 deletions
config.py.example
tasks.py
+12
-0
12 additions, 0 deletions
tasks.py
with
21 additions
and
0 deletions
config.py.example
+
9
−
0
View file @
7fdc3464
...
...
@@ -157,3 +157,12 @@ LATEX_BULLETPOINTS = [
# optional: include header and footer in asta-style, not just a page number on top
#LATEX_HEADER_FOOTER = True
HTML_LEVEL_OFFSET = 3
def dummy_todomail_provider():
return {"example": ("Name", "mail@example.com")}
# list of functions that return dicts mapping todomail-keys to a tuple containing name and mail address
ADDITIONAL_TODOMAIL_PROVIDERS = [
dummy_todomail_provider
]
This diff is collapsed.
Click to expand it.
tasks.py
+
12
−
0
View file @
7fdc3464
...
...
@@ -611,8 +611,20 @@ def send_todomails_async(protocol_id):
for
user
in
users
}
subject
=
"
Du hast noch was zu tun!
"
todomail_providers
=
getattr
(
config
,
"
ADDITIONAL_TODOMAIL_PROVIDERS
"
,
None
)
additional_todomails
=
{}
if
todomail_providers
:
for
provider
in
todomail_providers
:
todomail_dict
=
provider
()
for
key
in
todomail_dict
:
if
key
not
in
additional_todomails
:
name
,
mail
=
todomail_dict
[
key
]
additional_todomails
[
key
]
=
TodoMail
(
name
,
mail
)
for
user
in
users
:
todomail
=
TodoMail
.
query
.
filter
(
TodoMail
.
name
.
ilike
(
user
)).
first
()
if
todomail
is
None
:
if
user
in
additional_todomails
:
todomail
=
additional_todomails
[
user
]
if
todomail
is
None
:
error
=
protocol
.
create_error
(
"
Sending Todomail
"
,
"
Sending Todomail failed.
"
,
"
User {} has no Todo-Mail-Assignment.
"
.
format
(
user
))
db
.
session
.
add
(
error
)
...
...
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