Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/common.py
Show First 20 Lines • Show All 847 Lines • ▼ Show 20 Lines | def _set_deposit_origin_from_metadata(self, deposit, metadata, headers): | ||||
BAD_REQUEST, | BAD_REQUEST, | ||||
"<external_identifier> is deprecated, you should only use " | "<external_identifier> is deprecated, you should only use " | ||||
"<swh:create_origin> and <swh:add_to_origin> from now on.", | "<swh:create_origin> and <swh:add_to_origin> from now on.", | ||||
) | ) | ||||
if headers.slug and metadata["atom:external_identifier"] != headers.slug: | if headers.slug and metadata["atom:external_identifier"] != headers.slug: | ||||
raise DepositError( | raise DepositError( | ||||
BAD_REQUEST, | BAD_REQUEST, | ||||
"The 'external_identifier' tag is deprecated, " | "The <external_identifier> tag and Slug header are deprecated, " | ||||
"the Slug header should be used instead.", | "<swh:create_origin> or <swh:add_to_origin> " | ||||
"should be used instead.", | |||||
) | ) | ||||
def _empty_post( | def _empty_post( | ||||
self, | self, | ||||
request: Request, | request: Request, | ||||
headers: ParsedRequestHeaders, | headers: ParsedRequestHeaders, | ||||
collection_name: str, | collection_name: str, | ||||
deposit: Deposit, | deposit: Deposit, | ||||
▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines |