Errors: Add CommunityNotSelectedError for conditional check on config #595
Annotations
3 errors
invenio_records_resources/resources/errors.py#L1
isort-check
from ..errors import validation_error_to_list_errors
from ..services.errors import (
+ CannotRemoveCommunityError,
+ CommunityNotSelectedError,
FacetNotFoundError,
FailedFileUploadException,
FileKeyNotFoundError,
QuerystringValidationError,
RecordPermissionDeniedError,
RevisionIdMismatchError,
- CommunityNotSelectedError,
- CannotRemoveCommunityError,
)
|
invenio_records_resources/services/errors.py#L1
Black format check
--- /home/runner/work/invenio-records-resources/invenio-records-resources/invenio_records_resources/services/errors.py 2024-09-16 15:17:54.098143+00:00
+++ /home/runner/work/invenio-records-resources/invenio-records-resources/invenio_records_resources/services/errors.py 2024-09-16 15:20:34.389149+00:00
@@ -115,17 +115,14 @@
class CommunityNotSelectedError(Exception):
"""Error thrown when a record is being created/updated with less than 1 community."""
def __init__(self):
"""Constructor."""
- super().__init__(
- _("Cannot publish without selecting a community.")
- )
+ super().__init__(_("Cannot publish without selecting a community."))
+
class CannotRemoveCommunityError(Exception):
"""Error thrown when the last community is being removed from the record."""
def __init__(self):
"""Constructor."""
- super().__init__(
- _("A record should be part of atleast 1 community.")
- )
+ super().__init__(_("A record should be part of atleast 1 community."))
|
|
This job failed
Loading