Skip to content

Commit

Permalink
OM-349 Added additional logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
malinowskikam committed Oct 22, 2024
1 parent bd6c1d3 commit cb1a091
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions worker_voucher/schema.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

import graphene
import graphene_django_optimizer as gql_optimizer

Expand Down Expand Up @@ -32,6 +34,8 @@
get_group_worker_user_filters
)

logger = logging.getLogger(__name__)


class Query(ExportableQueryMixin, graphene.ObjectType):
exportable_fields = ['worker_voucher', 'worker']
Expand Down Expand Up @@ -211,8 +215,10 @@ def resolve_online_worker_data(self, info, national_id=None, economic_unit_code=

online_result = MConnectWorkerService().fetch_worker_data(national_id, info.context.user, eu)
if not online_result.get("success", False):
logger.error("Online worker data failed% %s", online_result)
raise AttributeError(online_result.get("error", _("Unknown Error")))

logger.info("Online worker data: %s", online_result)
return OnlineWorkerDataGQLType(
other_names=online_result["data"]["GivenName"],
last_name=online_result["data"]["FamilyName"],
Expand Down

0 comments on commit cb1a091

Please sign in to comment.