Skip to content

Commit

Permalink
Merge pull request #1817 from DSD-DBS/hide-session-text-wo-sessions
Browse files Browse the repository at this point in the history
feat: Hide "Sessions" part from feedback email if no sessions
  • Loading branch information
MoritzWeber0 authored Sep 21, 2024
2 parents 6828e3a + 31dd27c commit 39e13b5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/capellacollab/feedback/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ def format_email(
]
if feedback.trigger:
message_list.append(f"Trigger: {feedback.trigger}")
message_list.append("Sessions:")
message_list += [
session.model_dump_json(indent=2) for session in feedback.sessions
]

if feedback.sessions:
message_list.append("Sessions:")
message_list += [
session.model_dump_json(indent=2) for session in feedback.sessions
]

message_list.append("---")
message_list.append(
Expand Down

0 comments on commit 39e13b5

Please sign in to comment.