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
17b8461f
Commit
17b8461f
authored
8 years ago
by
Administrator
Browse files
Options
Downloads
Patches
Plain Diff
Added debug output for reminder mails
parent
baeab64f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
models/database.py
+7
-0
7 additions, 0 deletions
models/database.py
server.py
+4
-0
4 additions, 0 deletions
server.py
tasks.py
+2
-0
2 additions, 0 deletions
tasks.py
templates/index.html
+1
-1
1 addition, 1 deletion
templates/index.html
with
14 additions
and
1 deletion
models/database.py
+
7
−
0
View file @
17b8461f
...
@@ -538,6 +538,13 @@ class Todo(db.Model):
...
@@ -538,6 +538,13 @@ class Todo(db.Model):
]
]
return
"
"
.
join
(
parts
)
return
"
"
.
join
(
parts
)
def
render_html_short
(
self
):
parts
=
[
"
<strong>{}:</strong>
"
.
format
(
self
.
who
),
self
.
description
]
return
"
"
.
join
(
parts
)
def
render_latex
(
self
,
current_protocol
=
None
):
def
render_latex
(
self
,
current_protocol
=
None
):
return
r
"
\textbf{{{}}}: {}: {} -- {}
"
.
format
(
return
r
"
\textbf{{{}}}: {}: {} -- {}
"
.
format
(
"
Neuer Todo
"
if
self
.
is_new
(
current_protocol
)
else
"
Todo
"
,
"
Neuer Todo
"
if
self
.
is_new
(
current_protocol
)
else
"
Todo
"
,
...
...
This diff is collapsed.
Click to expand it.
server.py
+
4
−
0
View file @
17b8461f
...
@@ -1228,13 +1228,17 @@ def check_and_send_reminders():
...
@@ -1228,13 +1228,17 @@ def check_and_send_reminders():
with
app
.
app_context
():
with
app
.
app_context
():
current_time
=
datetime
.
now
()
current_time
=
datetime
.
now
()
current_day
=
current_time
.
date
()
current_day
=
current_time
.
date
()
print
(
"
regular action for reminders
"
)
for
protocol
in
Protocol
.
query
.
filter
(
Protocol
.
done
==
False
).
all
():
for
protocol
in
Protocol
.
query
.
filter
(
Protocol
.
done
==
False
).
all
():
day_difference
=
(
protocol
.
date
-
current_day
).
days
day_difference
=
(
protocol
.
date
-
current_day
).
days
usual_time
=
protocol
.
protocoltype
.
usual_time
usual_time
=
protocol
.
protocoltype
.
usual_time
protocol_time
=
datetime
(
1
,
1
,
1
,
usual_time
.
hour
,
usual_time
.
minute
)
protocol_time
=
datetime
(
1
,
1
,
1
,
usual_time
.
hour
,
usual_time
.
minute
)
hour_difference
=
(
protocol_time
-
current_time
).
seconds
//
3600
hour_difference
=
(
protocol_time
-
current_time
).
seconds
//
3600
print
(
"
diff: {} days, {} hours
"
.
format
(
day_difference
,
hour_difference
))
for
reminder
in
protocol
.
protocoltype
.
reminders
:
for
reminder
in
protocol
.
protocoltype
.
reminders
:
print
(
reminder
)
if
day_difference
==
reminder
.
days_before
and
hour_difference
==
0
:
if
day_difference
==
reminder
.
days_before
and
hour_difference
==
0
:
print
(
"
reminder matching, sending
"
)
tasks
.
send_reminder
(
reminder
,
protocol
)
tasks
.
send_reminder
(
reminder
,
protocol
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
tasks.py
+
2
−
0
View file @
17b8461f
...
@@ -445,8 +445,10 @@ def send_reminder_async(reminder_id, protocol_id):
...
@@ -445,8 +445,10 @@ def send_reminder_async(reminder_id, protocol_id):
protocol
=
Protocol
.
query
.
filter_by
(
id
=
protocol_id
).
first
()
protocol
=
Protocol
.
query
.
filter_by
(
id
=
protocol_id
).
first
()
reminder_text
=
render_template
(
"
reminder-mail.txt
"
,
reminder
=
reminder
,
protocol
=
protocol
)
reminder_text
=
render_template
(
"
reminder-mail.txt
"
,
reminder
=
reminder
,
protocol
=
protocol
)
if
reminder
.
send_public
:
if
reminder
.
send_public
:
print
(
"
sending public reminder mail to {}
"
.
format
(
protocol
.
protocoltype
.
public_mail
))
send_mail
(
protocol
,
protocol
.
protocoltype
.
public_mail
,
"
Tagesordnung der {}
"
.
format
(
protocol
.
protocoltype
.
name
),
reminder_text
)
send_mail
(
protocol
,
protocol
.
protocoltype
.
public_mail
,
"
Tagesordnung der {}
"
.
format
(
protocol
.
protocoltype
.
name
),
reminder_text
)
if
reminder
.
send_private
:
if
reminder
.
send_private
:
print
(
"
sending private reminder mail to {}
"
.
format
(
protocol
.
protocoltype
.
private_mail
))
send_mail
(
protocol
,
protocol
.
protocoltype
.
private_mail
,
"
Tagesordnung der {}
"
.
format
(
protocol
.
protocoltype
.
name
),
reminder_text
)
send_mail
(
protocol
,
protocol
.
protocoltype
.
private_mail
,
"
Tagesordnung der {}
"
.
format
(
protocol
.
protocoltype
.
name
),
reminder_text
)
def
send_protocol
(
protocol
):
def
send_protocol
(
protocol
):
...
...
This diff is collapsed.
Click to expand it.
templates/index.html
+
1
−
1
View file @
17b8461f
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<ul>
<ul>
{% if todos|length > 0 %}
{% if todos|length > 0 %}
{% for todo in todos %}
{% for todo in todos %}
<li>
{{todo.render_html()|safe}}
</li>
<li>
{{todo.render_html
_short
()|safe}}
</li>
{% endfor %}
{% endfor %}
{% else %}
{% else %}
<li>
Keine Todos
</li>
<li>
Keine Todos
</li>
...
...
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