Browse Source
Merge pull request #1449 from youichiro/fix_typo_of_exception_name
Fix typo of exception name
pull/1458/head
Hiroki Nakayama
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
backend/api/exceptions.py
-
backend/api/views/auto_labeling.py
|
|
@ -18,7 +18,7 @@ class AutoLabelingException(APIException): |
|
|
|
default_detail = 'Auto labeling not allowed for the document with labels.' |
|
|
|
|
|
|
|
|
|
|
|
class AutoLabeliingPermissionDenied(PermissionDenied): |
|
|
|
class AutoLabelingPermissionDenied(PermissionDenied): |
|
|
|
default_detail = 'You do not have permission to perform auto labeling.' \ |
|
|
|
'Please ask the project administrators to add you.' |
|
|
|
|
|
|
|
|
|
@ -16,7 +16,7 @@ from rest_framework.permissions import IsAuthenticated |
|
|
|
from rest_framework.response import Response |
|
|
|
from rest_framework.views import APIView |
|
|
|
|
|
|
|
from ..exceptions import (AutoLabeliingPermissionDenied, AutoLabelingException, |
|
|
|
from ..exceptions import (AutoLabelingException, AutoLabelingPermissionDenied, |
|
|
|
AWSTokenError, SampleDataException, |
|
|
|
TemplateMappingError, URLConnectionError) |
|
|
|
from ..models import AutoLabelingConfig, Example, Project |
|
|
@ -234,7 +234,7 @@ class AutoLabelingAnnotation(generics.CreateAPIView): |
|
|
|
example = self.get_example(project) |
|
|
|
config = project.auto_labeling_config.first() |
|
|
|
if not config: |
|
|
|
raise AutoLabeliingPermissionDenied() |
|
|
|
raise AutoLabelingPermissionDenied() |
|
|
|
return execute_pipeline( |
|
|
|
text=example, |
|
|
|
project_type=project.project_type, |
|
|
|