Skip to content

Commit e4b9acc

Browse files
committed
IEBH-31: Fixed ability to upload to core zone and download from greenroom zone
1 parent 677bca5 commit e4b9acc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app/commands/file.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from app.services.output_manager.error_handler import customized_error_msg
2727
from app.services.user_authentication.decorator import require_valid_token
2828
from app.utils.aggregated import doc
29-
from app.utils.aggregated import fit_terminal_width
3029
from app.utils.aggregated import get_file_info_by_geid
3130
from app.utils.aggregated import get_zone
3231
from app.utils.aggregated import identify_target_folder
@@ -133,9 +132,8 @@ def file_put(**kwargs): # noqa: C901
133132
user = UserConfig()
134133
zone = get_zone(zone) if zone else AppConfig.Env.green_zone.lower()
135134

136-
toc = customized_error_msg(ECustomizedError.TOU_CONTENT).replace(' ', '...')
137-
if zone.lower() == AppConfig.Env.core_zone.lower() and click.confirm(fit_terminal_width(toc), abort=True):
138-
pass
135+
if zone.lower() == AppConfig.Env.core_zone.lower():
136+
SrvErrorHandler.customized_handle(ECustomizedError.INVALID_ZONE, True)
139137

140138
if len(paths) == 0:
141139
SrvErrorHandler.customized_handle(ECustomizedError.INVALID_PATHS, True)
@@ -344,7 +342,7 @@ def file_list(paths, zone, page, page_size, detached):
344342
@click.option(
345343
'-z',
346344
'--zone',
347-
default=AppConfig.Env.green_zone,
345+
default=AppConfig.Env.core_zone,
348346
required=False,
349347
help=file_help.file_help_page(file_help.FileHELP.FILE_SYNC_Z),
350348
show_default=False,
@@ -377,6 +375,8 @@ def file_download(**kwargs):
377375
zone = get_zone(zone) if zone else AppConfig.Env.green_zone
378376
interactive = False if len(paths) > 1 else True
379377

378+
if zone.lower() == AppConfig.Env.green_zone.lower():
379+
SrvErrorHandler.customized_handle(ECustomizedError.INVALID_ZONE, True)
380380
if len(paths) == 0:
381381
SrvErrorHandler.customized_handle(ECustomizedError.MISSING_PROJECT_CODE, interactive)
382382
if geid:

app/resources/custom_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Error:
8383
'Please verify your role and check that the file exists.'
8484
),
8585
'FOLDER_NOT_FOUND': 'Folder not found in the Project.',
86-
'INVALID_ZONE': 'The data zone invalid. Please verify the data location and try again.',
86+
'INVALID_ZONE': 'The data zone is invalid. Please verify the data location and try again.',
8787
'FOLDER_EMPTY': 'Folder is empty.',
8888
'RESERVED_FOLDER': 'Reserved folder name, please rename the folder and try again later',
8989
'INVALID_ACTION': 'Invalid action: %s',

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "app"
3-
version = "2.2.6"
3+
version = "2.2.7"
44
description = "This service is designed to support pilot platform"
55
authors = ["Indoc Research"]
66

0 commit comments

Comments
 (0)