Skip to content

Commit 4169001

Browse files
committed
changed bypass perms to accept a list of models to bypass rather than a bool
1 parent 6283bcb commit 4169001

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

etc/woudc-contributor-feedback.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Data submissions now require the content, data generation, platform, instrument
55

66
Where possible, your submitted files have been manually repaired to contain the correct metadata information and resubmitted on your behalf. You do not need to resubmit the files, but please update your procedures to use the correct metadata for all future submissions. (Detailed data submission requirements are here: https://guide.woudc.org/en/#chapter-3-standard-data-format).
77

8+
For future submissions, you can validate your data using the WOUDC validator tool: https://woudc.org/en/contributors/validation
9+
This tool will check your submission for any warnings or errors. We recommend you fix all warnings and errors for your data to pass. This will reduce the amount of files that we will need to manually repair or fail.
10+
811
If your station, platform, agency or contact information have been updated then please reply to this message with the updated information.
912
Thank you for your support of WOUDC.
1013

woudc_data_registry/controller.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ def data():
233233
help='Path to main output directory for logs and reports')
234234
@click.option('--lax', '-l', 'lax', is_flag=True,
235235
help='Only validate core metadata tables')
236-
@click.option('--yes', '-y', 'bypass', is_flag=True, default=False,
237-
help='Bypass permission prompts while ingesting')
236+
@click.option('--yes', '-y', 'bypass', type=str, is_flag=False, default=False,
237+
help='list of models to bypass permission prompts for '
238+
'while ingesting')
238239
def ingest(ctx, source, reports_dir, lax, bypass, verbosity):
239240
"""ingest a single data submission or directory of files"""
240241

@@ -250,8 +251,9 @@ def ingest(ctx, source, reports_dir, lax, bypass, verbosity):
250251
dir_okay=True, file_okay=True))
251252
@click.option('--lax', '-l', 'lax', is_flag=True,
252253
help='Only validate core metadata tables')
253-
@click.option('--yes', '-y', 'bypass', is_flag=True, default=False,
254-
help='Bypass permission prompts while ingesting')
254+
@click.option('--yes', '-y', 'bypass', type=str, is_flag=False, default=False,
255+
help='list of models to bypass permission prompts for '
256+
'while ingesting')
255257
def verify(ctx, source, lax, bypass, verbosity):
256258
"""verify a single data submission or directory of files"""
257259

woudc_data_registry/processing.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def validate(self, extcsv, metadata_only=False, verify_only=False,
153153
else:
154154
contributor_ok = self.check_contributor()
155155

156-
platform_ok = self.check_station(bypass=bypass, verify=verify_only)
156+
platform_ok = self.check_station(bypass=('station' in bypass),
157+
verify=verify_only)
157158

158159
if not all([project_ok, contributor_ok, platform_ok]):
159160
LOGGER.warning('Skipping deployment check: depends on'
@@ -175,7 +176,7 @@ def validate(self, extcsv, metadata_only=False, verify_only=False,
175176
if verify_only:
176177
LOGGER.info('Verify mode. Skipping deployment addition.')
177178
deployment_ok = True
178-
elif self.add_deployment(bypass=bypass):
179+
elif self.add_deployment(bypass=('deployment' in bypass)):
179180
deployment_ok = True
180181

181182
self._add_to_report(407)
@@ -227,7 +228,8 @@ def validate(self, extcsv, metadata_only=False, verify_only=False,
227228
' addition.')
228229
instrument_ok = True
229230
else:
230-
instrument_ok = self.add_instrument(bypass=bypass)
231+
instrument_ok = self.add_instrument(bypass=(
232+
'instrument' in bypass))
231233

232234
if instrument_ok:
233235
self._add_to_report(406)
@@ -254,7 +256,8 @@ def validate(self, extcsv, metadata_only=False, verify_only=False,
254256
elif contribution_ok:
255257
contribution_exists = self.check_contribution()
256258
if not contribution_exists:
257-
contribution_ok = self.add_contribution(bypass=bypass)
259+
contribution_ok = self.add_contribution(bypass=(
260+
'contribution' in bypass))
258261

259262
if contribution_ok and (not contribution_exists):
260263
self._add_to_report(409)

0 commit comments

Comments
 (0)