diff --git a/backend/capellacollab/feedback/routes.py b/backend/capellacollab/feedback/routes.py index f99b2cbd1..c1299f00c 100644 --- a/backend/capellacollab/feedback/routes.py +++ b/backend/capellacollab/feedback/routes.py @@ -73,7 +73,11 @@ def submit_feedback( util.send_feedback_email, db, feedback, - feedback_user, + ( + users_models.User.model_validate(feedback_user) + if feedback_user + else None + ), user_agent, logger, ) diff --git a/backend/capellacollab/feedback/util.py b/backend/capellacollab/feedback/util.py index 403d3c625..9933488d6 100644 --- a/backend/capellacollab/feedback/util.py +++ b/backend/capellacollab/feedback/util.py @@ -51,7 +51,7 @@ def check_if_feedback_is_allowed(db: orm.Session): def format_email( feedback: models.Feedback, - user: users_models.DatabaseUser | None, + user: users_models.User | None, user_agent: str | None, ) -> email_models.EMailContent: rating = feedback.rating.value @@ -76,7 +76,7 @@ def format_email( message_list.append("---") message_list.append( - f"You receive this email because you're registered as feedback recipient in the " + f"You received this email because you're registered as feedback recipient in the " f"Capella Collaboration Manager ({config.general.scheme}://{config.general.host}:{config.general.port})." ) message_list.append( @@ -105,7 +105,7 @@ def format_email( def send_feedback_email( db: orm.Session, feedback: models.Feedback, - user: users_models.DatabaseUser | None, + user: users_models.User | None, user_agent: str | None, logger: logging.LoggerAdapter, ):