Skip to content

Commit

Permalink
Update imports for modernrpc classes
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Jan 5, 2025
1 parent 9b25228 commit 9c9c8d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tcms/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from datetime import timedelta

from modernrpc.handlers import JSONRPCHandler, XMLRPCHandler
from modernrpc.handlers.base import BaseResult, SuccessResult
from modernrpc.handlers.base import BaseResult
from modernrpc.handlers.jsonhandler import JsonResult, JsonSuccessResult
from modernrpc.handlers.xmlhandler import XmlSuccessResult


class KiwiTCMSJsonRpcHandler(JSONRPCHandler):
Expand Down Expand Up @@ -56,7 +57,7 @@ def escape_list(result_list):
__class__.escape_dict(item)

def dumps_result(self, result: BaseResult) -> str:
if isinstance(result, SuccessResult):
if isinstance(result, XmlSuccessResult):
if isinstance(result.data, timedelta):
result.data = result.data.total_seconds()
elif isinstance(result.data, dict):
Expand Down

0 comments on commit 9c9c8d5

Please sign in to comment.