Skip to content

Commit

Permalink
feat: Hide "Sessions" part from feedback email if no sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzWeber0 committed Sep 20, 2024
1 parent 08c9305 commit 31dd27c
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 31dd27c

Please sign in to comment.