Skip to content

Commit

Permalink
Merge pull request #298 from CDLUC3/fix-297
Browse files Browse the repository at this point in the history
Fix 297
  • Loading branch information
datadavev authored Jun 6, 2022
2 parents 37fc7ef + 84b88da commit 73bf547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ezidapp/management/commands/proc-crossref.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ def submit(self, task_model):

url = 'http://datacite.org/invalidDOI' if op_str == self.queue.DELETE else ref_id.target

# withdrawTitles is set to True if:
# The current operation is a DELETE
# OR
# the identifier is unvailable, meaning the identified resource is not available
submission, body, batchId = self._buildDeposit(
meta_dict['crossref'],
ref_id.owner.username,
id_base_str,
url,
withdrawTitles=(op_str == self.queue.DELETE or not ref_id.isReserved),
withdrawTitles=(op_str == self.queue.DELETE or ref_id.isUnavailable),
)

self._submitDeposit(submission, batchId, id_base_str)
Expand Down
3 changes: 3 additions & 0 deletions ezidapp/models/async_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ def __str__(self):
)

# Operation to perform
# A new identifier is being created
CREATE = "C"
# An existing identifier is being updated
UPDATE = "U"
# An existing identifier is being deleted
DELETE = "D"
OPERATION_CODE_TO_LABEL_DICT = {CREATE: "create", UPDATE: "update", DELETE: "delete"}
OPERATION_LABEL_TO_CODE_DICT = {v: k for k, v in OPERATION_CODE_TO_LABEL_DICT.items()}
Expand Down

0 comments on commit 73bf547

Please sign in to comment.