Skip to content

Commit

Permalink
use name instead of slugline for templates data based on new config […
Browse files Browse the repository at this point in the history
…SDBELGA-804] (#1989)

* use name instead of slugline for templates data based on config [SDBELGA-804]

* add new subject template and refactore code

* refactore code

* update template

* remove unwanted space
  • Loading branch information
devketanpro authored May 21, 2024
1 parent 96f38be commit a1ce060
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/planning/planning/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def _create_update_assignment(

translations = planning.get("translations")
translated_value = {}
translated_name = ""
translated_name = planning.get("name", planning.get("headline", ""))
doc.setdefault("planning", {})
if translations is not None and doc["planning"].get("language") is not None:
translated_value.update(
Expand Down
2 changes: 1 addition & 1 deletion server/planning/planning_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def _send_user_email(user_id, contact_id, source, meta_message, data):

admins = app.config["ADMINS"]

data["subject"] = "Superdesk assignment" + ": {}".format(data.get("slugline") if data.get("slugline") else "")
data["subject"] = render_template("assignment_mail_subject.txt", **data)
data["system_reciepient"] = get_assignment_acceptance_email_address()
html_message = _get_email_message_html(source, meta_message, data)
text_message = _get_email_message_string(source, meta_message, data)
Expand Down
1 change: 1 addition & 0 deletions server/planning/templates/assignment_mail_subject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Superdesk assignment: {{slugline}}

0 comments on commit a1ce060

Please sign in to comment.