Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/private/deposit_update_status.py
# Copyright (C) 2017-2020 The Software Heritage developers | # Copyright (C) 2017-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from rest_framework.parsers import JSONParser | from rest_framework.parsers import JSONParser | ||||
from swh.model.identifiers import DIRECTORY, swhid, REVISION, SNAPSHOT | from swh.model.identifiers import DIRECTORY, swhid, REVISION, SNAPSHOT | ||||
from . import SWHPrivateAPIView | from . import SWHPrivateAPIView | ||||
from ..common import SWHPutDepositAPI | from ..common import APIPut | ||||
from ...errors import make_error_dict, BAD_REQUEST | from ...errors import make_error_dict, BAD_REQUEST | ||||
from ...models import Deposit, DEPOSIT_STATUS_DETAIL | from ...models import Deposit, DEPOSIT_STATUS_DETAIL | ||||
from ...models import DEPOSIT_STATUS_LOAD_SUCCESS | from ...models import DEPOSIT_STATUS_LOAD_SUCCESS | ||||
MANDATORY_KEYS = ["origin_url", "revision_id", "directory_id", "snapshot_id"] | MANDATORY_KEYS = ["origin_url", "revision_id", "directory_id", "snapshot_id"] | ||||
class SWHUpdateStatusDeposit(SWHPrivateAPIView, SWHPutDepositAPI): | class SWHUpdateStatusDeposit(SWHPrivateAPIView, APIPut): | ||||
"""Deposit request class to update the deposit's status. | """Deposit request class to update the deposit's status. | ||||
HTTP verbs supported: PUT | HTTP verbs supported: PUT | ||||
""" | """ | ||||
parser_classes = (JSONParser,) | parser_classes = (JSONParser,) | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |