-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grade Publishing Reminder Email in
send_reminders
(#2284)
* Factor out Course.objects_with_missing_final_grades * EmailTemplate: Typing, send_to_address helper * Grade reminder email as part of send_reminders * Use unordered_groupby in web-view as well * unnecessary-lambda-assignment is checked by ruff * Introduce and use MonthAndDay instead of datetime.date * Move django-unrelated stuff into evap.tools * Enforce kw-only args on EmailTemplate.send_to_user --------- Co-authored-by: janno42 <[email protected]> Co-authored-by: Niklas Mohrin <[email protected]>
- Loading branch information
1 parent
079c9f4
commit bfd3d4b
Showing
23 changed files
with
493 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
evap/evaluation/migrations/0146_grade_reminder_template.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from django.db import migrations | ||
|
||
|
||
emailtemplates = [ | ||
("Grade Reminder", "[EvaP] Notenveröffentlichung für {{semester.name_de}} / Grade publishing for {{semester.name_en}}"), | ||
] | ||
|
||
|
||
def insert_emailtemplates(apps, _schema_editor): | ||
EmailTemplate = apps.get_model("evaluation", "EmailTemplate") | ||
|
||
for name, subject in emailtemplates: | ||
EmailTemplate.objects.create(name=name, subject=subject, plain_content="", html_content="") | ||
|
||
|
||
def remove_emailtemplates(apps, _schema_editor): | ||
EmailTemplate = apps.get_model("evaluation", "EmailTemplate") | ||
|
||
for name, __ in emailtemplates: | ||
EmailTemplate.objects.filter(name=name).delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('evaluation', '0145_rename_degree_to_program'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(insert_emailtemplates, reverse_code=remove_emailtemplates), | ||
] |
Oops, something went wrong.