Skip to content

Commit

Permalink
Update get_all_dataset_lock_info.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jggautier committed May 4, 2022
1 parent d22728c commit 214ecca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions other_scripts/get_all_dataset_lock_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import requests
import time
# Import RT python module to get info from emails


# From user get installation URL, apiToken, directory to save CSV file
Expand Down Expand Up @@ -74,6 +75,13 @@ def convert_to_local_tz(timestamp, shortDate=False):

count += 1

# Get the dataset's title metadata and use the Search API to see if any datasets with
# the same title have already been created. Save any matches as a list of dataset PIDs

# Get the dataset contact email and check RT to see if the depositor has emailed
# support. They might have already emailed support about the locked dataset
# Save any matches as a list of RT ticket IDs

for lock in data['data']:
datasetUrl = f'{installationUrl}/dataset.xhtml?persistentId={datasetPid}'
reason = lock['lockType']
Expand All @@ -82,3 +90,5 @@ def convert_to_local_tz(timestamp, shortDate=False):
f.writerow([datasetPid, datasetUrl, reason, lockedDate, userName])

print('%s of %s datasets: %s' % (count, total, datasetPid))

#

0 comments on commit 214ecca

Please sign in to comment.