Skip to content

Commit

Permalink
Merge pull request #1469 from the-deep/dependabot/pip/pip-b01173952f
Browse files Browse the repository at this point in the history
Bump the pip group across 1 directory with 7 updates
  • Loading branch information
AdityaKhatri authored Apr 5, 2024
2 parents 3e2655f + 9bdedc0 commit bbfdef2
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 75 deletions.
8 changes: 6 additions & 2 deletions apps/deepl_integration/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Type
import logging
from rest_framework import serializers

from django.db import transaction, models
Expand Down Expand Up @@ -31,6 +32,8 @@

from .models import DeeplTrackBaseModel

logger = logging.getLogger(__name__)


class BaseCallbackSerializer(serializers.Serializer):
nlp_handler: Type[BaseHandler]
Expand All @@ -41,9 +44,10 @@ def validate(self, data):
client_id = data['client_id']
try:
data['object'] = self.nlp_handler.get_object_using_client_id(client_id)
except Exception as e:
except Exception:
logger.error('Failed to parse client id', exc_info=True)
raise serializers.ValidationError({
'client_id': str(e),
'client_id': 'Failed to parse client id',
})
return data

Expand Down
8 changes: 6 additions & 2 deletions apps/questionnaire/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import django_filters
import logging
from django.db import models
from rest_framework.decorators import action
from rest_framework import (
Expand Down Expand Up @@ -33,6 +34,8 @@

from .filter_set import QuestionnaireFilterSet

logger = logging.getLogger(__name__)


class QuestionnaireViewSet(viewsets.ModelViewSet):
serializer_class = QuestionnaireSerializer
Expand Down Expand Up @@ -277,8 +280,9 @@ def post(self, request, *args, **kwargs):
xlsform_file = serializer.validated_data['file']
try:
return response.Response(xls_form.XLSForm.create_enketo_form(xlsform_file))
except Exception as e:
raise exceptions.ValidationError(str(e))
except Exception:
logger.error('Failed to create enketo form', exc_info=True)
raise exceptions.ValidationError('Failed to create enketo form')


class KoboToolboxExport(views.APIView):
Expand Down
Loading

0 comments on commit bbfdef2

Please sign in to comment.