Skip to content

Commit

Permalink
fix: remove unnecessary type hint in MessageService for improved clarity
Browse files Browse the repository at this point in the history
Signed-off-by: -LAN- <[email protected]>
  • Loading branch information
laipz8200 committed Dec 24, 2024
1 parent 923dfc1 commit 5d5fb07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/services/message_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ def create_feedback(
user: Optional[Union[Account, EndUser]],
rating: Optional[str],
content: Optional[str],
) -> MessageFeedback:
):
if not user:
raise ValueError("user cannot be None")

message = cls.get_message(app_model=app_model, user=user, message_id=message_id)

feedback: MessageFeedback = message.user_feedback if isinstance(user, EndUser) else message.admin_feedback
feedback = message.user_feedback if isinstance(user, EndUser) else message.admin_feedback

if not rating and feedback:
db.session.delete(feedback)
Expand Down

0 comments on commit 5d5fb07

Please sign in to comment.