Skip to content

Commit a4d6054

Browse files
authored
Merge pull request #171 from man-group/fix_mailfrom
passing mailfrom around
2 parents 4e545d7 + d8e6935 commit a4d6054

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
0.6.2 (2024-05-xx)
22
------------------
33
* Chore: Applying & enforcing Black and Prettier to Python and JS code, respectively. Setting Black version to 22.8.0 for CircleCI.
4+
* Bugfix: Preserve the "mailfrom" parameter on notebook rerun.
45

56
0.6.1 (2024-02-26)
67
------------------

notebooker/execute_notebook.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ def run_report_in_subprocess(
514514
scheduler_job_id=scheduler_job_id,
515515
is_slideshow=is_slideshow,
516516
email_subject=email_subject,
517+
mailfrom=mailfrom,
517518
)
518519

519520
command = (

notebooker/serialization/mongo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def save_check_stub(
208208
scheduler_job_id: Optional[str] = None,
209209
is_slideshow: bool = False,
210210
email_subject: Optional[str] = None,
211+
mailfrom: Optional[str] = None,
211212
) -> None:
212213
"""Call this when we are just starting a check. Saves a "pending" job into storage."""
213214
job_start_time = job_start_time or datetime.datetime.now()
@@ -226,6 +227,7 @@ def save_check_stub(
226227
hide_code=hide_code,
227228
scheduler_job_id=scheduler_job_id,
228229
is_slideshow=is_slideshow,
230+
mailfrom=mailfrom,
229231
)
230232
self._save_to_db(pending_result)
231233

@@ -316,6 +318,7 @@ def _convert_result(
316318
generate_pdf_output=result.get("generate_pdf_output", True),
317319
report_title=result.get("report_title", result["report_name"]),
318320
mailto=result.get("mailto", ""),
321+
mailfrom=result.get("mailfrom", ""),
319322
error_mailto=result.get("error_mailto", ""),
320323
hide_code=result.get("hide_code", False),
321324
stdout=result.get("stdout", []),
@@ -334,6 +337,7 @@ def _convert_result(
334337
generate_pdf_output=result.get("generate_pdf_output", True),
335338
report_title=result.get("report_title", result["report_name"]),
336339
mailto=result.get("mailto", ""),
340+
mailfrom=result.get("mailfrom", ""),
337341
error_mailto=result.get("error_mailto", ""),
338342
email_subject=result.get("email_subject", ""),
339343
hide_code=result.get("hide_code", False),
@@ -359,6 +363,7 @@ def _convert_result(
359363
generate_pdf_output=result.get("generate_pdf_output", True),
360364
report_title=result.get("report_title", result["report_name"]),
361365
mailto=result.get("mailto", ""),
366+
mailfrom=result.get("mailfrom", ""),
362367
error_mailto=result.get("error_mailto", ""),
363368
email_subject=result.get("email_subject", ""),
364369
hide_code=result.get("hide_code", False),

notebooker/web/routes/report_execution.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def _rerun_report(job_id, prepare_only=False, run_synchronously=False):
261261
run_synchronously=run_synchronously,
262262
is_slideshow=result.is_slideshow,
263263
email_subject=result.email_subject,
264+
mailfrom=result.mailfrom,
264265
)
265266
return new_job_id
266267

notebooker/web/templates/results.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ <h4>Mailing results to:</h4> {{ result.mailto }}
6262
{% if result.error_mailto %}
6363
<h4>Mailing errors to:</h4> {{ result.error_mailto }}
6464
{% endif %}
65+
{% if result.mailfrom %}
66+
<h4>Mailing results from:</h4> {{ result.mailfrom }}
67+
{% endif %}
6568
{% if result.email_subject %}
6669
<h4>Email subject:</h4> {{ result.email_subject }}
6770
{% endif %}

0 commit comments

Comments
 (0)